1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 16:37:40 +00:00

fixed more fallthroughs, added exception hr_wrong_geometry

This commit is contained in:
Zeno Rogue
2021-03-12 22:59:24 +01:00
parent eb6322b864
commit 5f86ed6b4b
4 changed files with 8 additions and 2 deletions

View File

@@ -427,7 +427,7 @@ EX namespace bt {
} }
#endif #endif
default: default:
throw hr_wrong_dir(); throw hr_wrong_geometry();
} }
} }
@@ -484,6 +484,7 @@ EX namespace bt {
add(-2 * t0 + shift1); add(-2 * t0 + shift1);
} }
} }
break;
case gHoroRec: { case gHoroRec: {
ld r2 = sqrt(2); ld r2 = sqrt(2);
for(int y=-1; y<=1; y++) for(int x=-1; x<=1; x+=2) for(int z=-1; z<=1; z++) for(int y=-1; y<=1; y++) for(int x=-1; x<=1; x+=2) for(int z=-1; z<=1; z++)

View File

@@ -103,6 +103,8 @@ struct hr_shortest_path_exception: hr_exception { };
struct hr_wrong_dir: hr_exception { }; struct hr_wrong_dir: hr_exception { };
struct hr_wrong_geometry: hr_exception { };
// genus (in grammar) // genus (in grammar)
#define GEN_M 0 #define GEN_M 0
#define GEN_F 1 #define GEN_F 1

View File

@@ -426,10 +426,12 @@ EX namespace sn {
case 7: case 7:
case 8: case 8:
return xpush(bw*(4.5-j)) * zpush(-1) * ypush(bw*(i-7)); return xpush(bw*(4.5-j)) * zpush(-1) * ypush(bw*(i-7));
default:
throw hr_wrong_dir;
} }
} }
default: throw "not nihsolv"; default: throw hr_wrong_geometry;
} }
} }

View File

@@ -1761,6 +1761,7 @@ EX namespace patterns {
if(arcm::in()) return colortables['A'][arcm::current.tilegroup[arcm::id_of(c->master)]]; if(arcm::in()) return colortables['A'][arcm::current.tilegroup[arcm::id_of(c->master)]];
#endif #endif
if(arb::in()) return colortables['A'][c->master->zebraval + c->master->emeraldval * isize(arb::current.shapes)]; if(arb::in()) return colortables['A'][c->master->zebraval + c->master->emeraldval * isize(arb::current.shapes)];
return colortables['B'][c->type & 15];
case 'B': case 'B':
return colortables['B'][c->type & 15]; return colortables['B'][c->type & 15];
#if CAP_FIELD #if CAP_FIELD