mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 15:20:27 +00:00
prevent freezes in West Wall with wrong data
This commit is contained in:
parent
4902d2db8d
commit
683ab67ad9
@ -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));
|
||||||
|
Loading…
Reference in New Issue
Block a user