Safety valve against candelabrum's .age becoming 0
This may have happened in a 3.7 game on Hardfought. Even if it didn't, I'm still uncomfortable with the potential for the game to potentially become unwinnable as a consequence of age field corruption. Add an impossible() for when this situation happens, and code after the impossible() to repair the game by removing the candles.
This commit is contained in:
@@ -1188,6 +1188,13 @@ register struct obj *obj;
|
||||
1 would yield 0, confusing begin_burn() and producing an
|
||||
unlightable, unrefillable candelabrum; round up instead */
|
||||
obj->age = (obj->age + 1L) / 2L;
|
||||
|
||||
/* to make absolutely sure the game doesn't become unwinnable as
|
||||
a consequence of a broken candelabrum */
|
||||
if (obj->age == 0) {
|
||||
impossible("Candelabrum with candles but no fuel?");
|
||||
obj->age = 1;
|
||||
}
|
||||
} else {
|
||||
if (obj->spe == 7) {
|
||||
if (Blind)
|
||||
|
||||
Reference in New Issue
Block a user