From: Pasi Kallinen Date: Wed, 15 Apr 2015 17:06:38 +0000 (+0300) Subject: Prevent infinite loop X-Git-Tag: NetHack-3.6.0_RC01~478^2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97f6834730c53204ace1b9a9d483a897e406dff6;p=nethack Prevent infinite loop ...if the map is filled with monsters, and for some reason the drowning just won't kill you. Infinite looping cannot currently happen, because no-one who can drown can keep surviving the drowning once their amulet of life saving is used up. --- diff --git a/src/trap.c b/src/trap.c index aff2b9719..037c73255 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3470,7 +3470,7 @@ drown() } u.uinwater = 1; You("drown."); - for (;;) { + for (i = 0; i < 5; i++) { /* arbitrary number of loops */ /* killer format and name are reconstructed every iteration because lifesaving resets them */ pool_of_water = waterbody_name(u.ux, u.uy);