1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-25 22:53:19 +00:00

field pattern on Euclidean does torus instead of crashing

This commit is contained in:
Zeno Rogue 2017-12-03 16:12:20 +01:00
parent c5324ff2f5
commit f2af1d63f6
2 changed files with 10 additions and 2 deletions

View File

@ -992,6 +992,14 @@ namespace mapeditor {
case 'H':
return towerval(c);
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);
return 10*p.first + (p.second?6:7);
}
@ -1023,7 +1031,7 @@ namespace mapeditor {
if(drawcell == cwt.c) return vid.cs.charid;
if(drawcell->monst) return drawcell->monst;
if(drawcell->item) return drawcell->item;
return subpattern(drawcell);
return subpattern(drawcell) % (USERSHAPEIDS);
}
int subpatternShape(int i) {

View File

@ -971,7 +971,7 @@ hpcshape
#define USERLAYERS 32
#define USERSHAPEGROUPS 8
#define USERSHAPEIDS 256
#define USERSHAPEIDS 4096
struct usershapelayer {
vector<hyperpoint> list;