mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-31 01:42:24 +01:00
Merge pull request #1542 from NeroOneTrueKing/patch-fix-crash
Don't desummon in-use objects causing double delete
This commit is contained in:
commit
5d46a447d0
1 changed files with 6 additions and 3 deletions
|
@ -2523,9 +2523,12 @@ long timeout;
|
|||
if (otmp == MON_WEP(otmp->ocarry)) MON_NOWEP(otmp->ocarry);
|
||||
if (otmp == MON_SWEP(otmp->ocarry)) MON_NOSWEP(otmp->ocarry);
|
||||
}
|
||||
obj_extract_self(otmp);
|
||||
newsym(otmp->ox, otmp->oy);
|
||||
obfree(otmp, (struct obj *)0);
|
||||
/* if in_use is set, then we know it'll be used up by the thing currently using it, and we'd be double-deleting it */
|
||||
if (!otmp->in_use) {
|
||||
obj_extract_self(otmp);
|
||||
newsym(otmp->ox, otmp->oy);
|
||||
obfree(otmp, (struct obj *)0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue