From 1876fa4eb67acd053f5e7afa940b01762586f1f5 Mon Sep 17 00:00:00 2001 From: bsxf47 Date: Wed, 13 Jul 2016 19:12:55 +0200 Subject: [PATCH] Prevent further script events only if Entity is destroyed 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 --- src/script/ScriptedIOControl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/script/ScriptedIOControl.cpp b/src/script/ScriptedIOControl.cpp index 01f1b605d0..ac2d5377c9 100644 --- a/src/script/ScriptedIOControl.cpp +++ b/src/script/ScriptedIOControl.cpp @@ -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;