OSDN Git Service

Adopted correction for division by zero exception in battle_monsters() from upstream...
authorEric Branlund <ebranlund@fastmail.com>
Thu, 7 Nov 2019 05:11:40 +0000 (21:11 -0800)
committerEric Branlund <ebranlund@fastmail.com>
Thu, 7 Nov 2019 05:11:40 +0000 (21:11 -0800)
src/bldg.c

index 7173f57..2185bfc 100644 (file)
@@ -1448,6 +1448,7 @@ void battle_monsters(void)
                }
                for (i=0;i<4;i++)
                {
+                       if (power[i] <= 0) break;
                        power[i] = total*60/power[i];
                        if (tekitou && ((power[i] < 160) || power[i] > 1500)) break;
                        if ((power[i] < 160) && randint0(20)) break;