diff --git a/src/scene/Interactive.cpp b/src/scene/Interactive.cpp index 137481648d..615bff146d 100644 --- a/src/scene/Interactive.cpp +++ b/src/scene/Interactive.cpp @@ -2521,11 +2521,11 @@ void RenderInter() { static std::vector toDestroy; -void ARX_INTERACTIVE_DestroyIOdelayed(Entity * entity) { +bool ARX_INTERACTIVE_DestroyIOdelayed(Entity * entity) { if((entity->ioflags & IO_ITEM) && entity->_itemdata->count > 1) { entity->_itemdata->count--; - return; + return false; } LogDebug("will destroy entity " << entity->idString()); @@ -2533,6 +2533,7 @@ void ARX_INTERACTIVE_DestroyIOdelayed(Entity * entity) { toDestroy.push_back(entity); } + return true; } void ARX_INTERACTIVE_DestroyIOdelayedRemove(Entity * entity) { diff --git a/src/scene/Interactive.h b/src/scene/Interactive.h index 01abd7a6d4..af002651b9 100644 --- a/src/scene/Interactive.h +++ b/src/scene/Interactive.h @@ -102,7 +102,15 @@ void PrepareIOTreatZone(long flag = 0); void LinkObjToMe(Entity * io, Entity * io2, const std::string & attach); -void ARX_INTERACTIVE_DestroyIOdelayed(Entity * entity); +/*! + * Destroy an entity at the end of the current frame + * + * For items with a count over 1 the count is (immediately) descreased + * and the entity is not destroyed. + * + * \return true if the entity will be destroyed. + */ +bool ARX_INTERACTIVE_DestroyIOdelayed(Entity * entity); void ARX_INTERACTIVE_DestroyIOdelayedRemove(Entity * entity); void ARX_INTERACTIVE_DestroyIOdelayedExecute();