mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-17 16:32:50 +00:00
field pattern on Euclidean does torus instead of crashing
This commit is contained in:
parent
c5324ff2f5
commit
f2af1d63f6
@ -992,6 +992,14 @@ namespace mapeditor {
|
|||||||
case 'H':
|
case 'H':
|
||||||
return towerval(c);
|
return towerval(c);
|
||||||
case 'F': {
|
case 'F': {
|
||||||
|
if(euclid) {
|
||||||
|
using namespace torusconfig;
|
||||||
|
eucoord cx, cy;
|
||||||
|
decodeMaster(c->master, cx, cy);
|
||||||
|
int cd = cx * dx + cy * dy;
|
||||||
|
cd %= qty; if(cd<0) cd += qty;
|
||||||
|
return cd;
|
||||||
|
}
|
||||||
pair<int, bool> p = fieldpattern::fieldval(c);
|
pair<int, bool> p = fieldpattern::fieldval(c);
|
||||||
return 10*p.first + (p.second?6:7);
|
return 10*p.first + (p.second?6:7);
|
||||||
}
|
}
|
||||||
@ -1023,7 +1031,7 @@ namespace mapeditor {
|
|||||||
if(drawcell == cwt.c) return vid.cs.charid;
|
if(drawcell == cwt.c) return vid.cs.charid;
|
||||||
if(drawcell->monst) return drawcell->monst;
|
if(drawcell->monst) return drawcell->monst;
|
||||||
if(drawcell->item) return drawcell->item;
|
if(drawcell->item) return drawcell->item;
|
||||||
return subpattern(drawcell);
|
return subpattern(drawcell) % (USERSHAPEIDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int subpatternShape(int i) {
|
int subpatternShape(int i) {
|
||||||
|
@ -971,7 +971,7 @@ hpcshape
|
|||||||
|
|
||||||
#define USERLAYERS 32
|
#define USERLAYERS 32
|
||||||
#define USERSHAPEGROUPS 8
|
#define USERSHAPEGROUPS 8
|
||||||
#define USERSHAPEIDS 256
|
#define USERSHAPEIDS 4096
|
||||||
|
|
||||||
struct usershapelayer {
|
struct usershapelayer {
|
||||||
vector<hyperpoint> list;
|
vector<hyperpoint> list;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user