Fix segfault when carried box explodes

Opening a trapped box in inventory, if the box exploded and was
not destroyed, then temporary variable otmp was pointing to null.
This commit is contained in:
Pasi Kallinen
2026-01-06 20:58:13 +02:00
parent 4b5b146674
commit b9d781e0b2

View File

@@ -6400,7 +6400,7 @@ chest_trap(
bot(); /* to get immediate botl re-display */
}
otmp->tknown = 1; /* hero knows chest is no longer trapped */
obj->tknown = 1; /* hero knows chest is no longer trapped */
return FALSE;
}