Skip to content

Commit

Permalink
Prevent further script events only if Entity is destroyed
Browse files Browse the repository at this point in the history
ARX_INTERACTIVE_DestroyIOdelayed() destroys an Entity only if its count is 1 or less. Script events are thus disabled only for soon-to-be-destroyed Entities.

Fixes: bug #751
  • Loading branch information
bsxf-47 authored and dscharrer committed Jul 18, 2016
1 parent 9e8b3a3 commit 1876fa4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/script/ScriptedIOControl.cpp
Expand Up @@ -660,10 +660,13 @@ class DestroyCommand : public Command {
ARX_INTERACTIVE_DestroyIOdelayed(entity);

// Prevent further script events as the object has been destroyed!
entity->show = SHOW_FLAG_MEGAHIDE;
entity->ioflags |= IO_FREEZESCRIPT;
if(entity == context.getEntity()) {
return AbortAccept;
// Object is destroyed only if its count is 1 or less
if(entity->_itemdata->count <= 1) {
entity->show = SHOW_FLAG_MEGAHIDE;
entity->ioflags |= IO_FREEZESCRIPT;
if(entity == context.getEntity()) {
return AbortAccept;
}
}

return Success;
Expand Down

0 comments on commit 1876fa4

Please sign in to comment.