Commit 80d964c
committed
Fix: mselftouch call was not guarded by a "lost gloves" check
xNetHack adds a mselftouch call in extract_from_minvent to handle cases
like someone's glass gauntlets shattering and resulting in them handling
a cockatrice corpse. But it was called every time a monster lost an
inventory item without first checking whether the monster was actually
losing gloves. (mselftouch itself, somewhat unintuitively, does not
check whether the monster is still wearing gloves, an assumption I made
explicit in a comment in this commit.)
As a result, a monster could get insta-petrified while losing *any*
inventory item while wielding a cockatrice corpse even if their gloves
should have still protected them.
This commit fixes that issue by only calling mselftouch in
extract_from_minvent if the gloves are what's being extracted.1 parent 7f1721f commit 80d964c
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3962 | 3962 | | |
3963 | 3963 | | |
3964 | 3964 | | |
| 3965 | + | |
| 3966 | + | |
3965 | 3967 | | |
3966 | 3968 | | |
3967 | 3969 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1452 | 1452 | | |
1453 | 1453 | | |
1454 | 1454 | | |
1455 | | - | |
| 1455 | + | |
| 1456 | + | |
1456 | 1457 | | |
1457 | 1458 | | |
1458 | 1459 | | |
| |||
0 commit comments