Skip to content

Commit

Permalink
char: fix null deref when trying to remove trap (#657)
Browse files Browse the repository at this point in the history
Cutting down a web can try to remove the trap from a character on the
square that isn't actually trapped.  Do nothing in this case.
  • Loading branch information
bkoropoff authored Dec 12, 2024
1 parent 9fa78a2 commit e7d7248
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Main/Source/char.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12099,6 +12099,8 @@ struct trapidcomparer
void character::RemoveTrap(ulong ID)
{
trapdata*& T = ListFind(TrapData, trapidcomparer(ID));
if (T == nullptr)
return;
trapdata* ToDel = T;
T = T->Next;
delete ToDel;
Expand Down

0 comments on commit e7d7248

Please sign in to comment.