From 42b1e36cbcc43fa4b443567373a09290339d703c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 6 Nov 2017 22:19:22 +0100 Subject: [PATCH] fixed a freeze bug in Hunting Ground+Chaos+octagonal --- landgen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/landgen.cpp b/landgen.cpp index e22d92b1..ba7ab4ef 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -1629,7 +1629,8 @@ void giantLandSwitch(cell *c, int d, cell *from) { forCellEx(c4, c3) if(c4->mpdist > 7 && !isNeighbor(c4, c)) dogcells.push_back(c4); if(items[itHunting] < 10 && size(dogcells) >= 2) { - while(true) { + for(int t=0;; t++) { + if(t == 50) { c->item = itNone; break; } cell *dog1 = dogcells[hrand(size(dogcells))]; cell *dog2 = dogcells[hrand(size(dogcells))]; if(isNeighbor(dog1, dog2)) {