1
0
Fork 0
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:
Chris-plus-alphanumericgibberish 2021-05-27 14:27:14 -04:00 committed by GitHub
commit 5d46a447d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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