melting ice timeout issues

Reported directly to devteam by entrez via email:
>
> I noticed some potential issues with (melting) ice:
>
>   * Digging down into ice, or setting a land mine on the ice and
>   triggering it, doesn't remove the melt_ice timeout, so it can result
>   in a sequence like dig down -> pit fills with water -> freeze water
>   -> freezing water tries to set melt_ice timeout -> duplicate timeout
>   impossible.  Or if you don't freeze the water again, melt_ice will
>   run on a non-ice surface, which might at least produce strange
>   messages.
>
>   * Setting a land mine on ice: melting ice doesn't do anything with
>   the trap, so there is still a land mine which you can trigger by
>   flying over the water (the land mine's trigger is also still
>   described as being 'in a pile of soil', despite being underwater at
>   this point).  Similar thing happens with bear traps.
>
>   * Not really related to _melting_ ice, but an exploding land mine
>   doesn't reset the typ from ICE to FLOOR (like normal digging does),
>   so it will result in a square with a pit that is also an ice square,
>   where the ice can melt under the pit and produce a combination
>   pit/moat.  If you then freeze the moat, the pit reappears on top of
>   the ice.
This commit is contained in:
nhmall
2021-10-16 22:22:33 -04:00
parent 91b4e4570d
commit 17165e3b92
7 changed files with 94 additions and 42 deletions

View File

@@ -1860,7 +1860,7 @@ timer_sanity_check(void)
timer_element *curr;
/* this should be much more complete */
for (curr = g.timer_base; curr; curr = curr->next)
for (curr = g.timer_base; curr; curr = curr->next) {
if (curr->kind == TIMER_OBJECT) {
struct obj *obj = curr->arg.a_obj;
@@ -1868,7 +1868,20 @@ timer_sanity_check(void)
impossible("timer sanity: untimed obj %s, timer %ld",
fmt_ptr((genericptr_t) obj), curr->tid);
}
} else if (curr->kind == TIMER_LEVEL) {
long where = curr->arg.a_long;
xchar x = (xchar) ((where >> 16) & 0xFFFF),
y = (xchar) (where & 0xFFFF);
if (!isok(x, y)) {
impossible("timer sanity: spot timer %d at <%d,%d>",
curr->tid, x, y);
} else if (curr->func_index == MELT_ICE_AWAY && !is_ice(x, y)) {
impossible("timer sanity: melt timer %d on non-ice %d <%d,%d>",
curr->tid, levl[x][y].typ, x, y);
}
}
}
}
/*