Skip to content

Commit

Permalink
Fix crash when removing container in action onUse event
Browse files Browse the repository at this point in the history
  • Loading branch information
marksamman committed May 25, 2016
1 parent 760d2ba commit b5892ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ ReturnValue Actions::internalUseItem(Player* player, const Position& pos, uint8_
}
}

if (item->isRemoved()) {
return RETURNVALUE_CANNOTUSETHISOBJECT;
}

if (BedItem* bed = item->getBed()) {
if (!bed->canUse(player)) {
return RETURNVALUE_CANNOTUSETHISOBJECT;
Expand Down

0 comments on commit b5892ef

Please sign in to comment.