mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-08-11 23:21:37 +01:00
Bugpaper: check if uamul is null before trying to dereference it.
Some that reads through inventory directly (like theft) sometimes hits objects that claim to be worn amulets but aren't. This is probably a bad sign, but we can deal with it more gracefully than crashes.
This commit is contained in:
parent
73a50a46be
commit
63c0685de1
1 changed files with 5 additions and 1 deletions
|
@ -911,7 +911,11 @@ void
|
|||
Amulet_off()
|
||||
{
|
||||
takeoff_mask &= ~W_AMUL;
|
||||
|
||||
|
||||
if(!uamul){
|
||||
impossible("Amulet_off() was called, but no amulet is worn.");
|
||||
return;
|
||||
}
|
||||
switch(uamul->otyp) {
|
||||
case AMULET_OF_ESP:
|
||||
/* need to update ability before calling see_monsters() */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue