1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-31 19:36:16 +00:00

prevent freezes in West Wall with wrong data

This commit is contained in:
Zeno Rogue 2021-08-08 18:32:10 +02:00
parent 4902d2db8d
commit 683ab67ad9

View File

@ -225,6 +225,13 @@ EX namespace westwall {
again: again:
cell *at = whirlline[isize(whirlline)-1]; cell *at = whirlline[isize(whirlline)-1];
cell *prev = whirlline[isize(whirlline)-2]; cell *prev = whirlline[isize(whirlline)-2];
if(isize(whirlline) > 2 && at == whirlline[isize(whirlline)/2]) {
/* something weird must have happened... */
static bool once = true;
if(once) addMessage("warning: a bug in building a whirl line");
once = false;
return;
}
for(int i=0; i<at->type; i++) for(int i=0; i<at->type; i++)
if(at->move(i) && coastvalEdge1(at->move(i)) == d && at->move(i) != prev) { if(at->move(i) && coastvalEdge1(at->move(i)) == d && at->move(i) != prev) {
whirlline.push_back(at->move(i)); whirlline.push_back(at->move(i));