Closed KitRifty closed 3 years ago
Currently moving the fix instead to the entity's destructor. However, would still like to have CBaseNPCIntention's behavior destroyed in UpdateOnRemove() since it's still safe to access the entity and call virtual functions, needed for good cleanup code.
Additionally this also fixes cases where trying to access Handles during OnEnd
or OnRemove
would result in an invalid handle error, especially during a map change, plugin reload, or server shutdown.
Currently, attempting to access a user-defined property in a custom entity in
OnEntityDestroyed()
or a NextBotAction'sOnEnd()
callback during destruction will result in an error due to theGetDataDescMap
hook removed prior to those calls.This fix delays the cleanup to a post-hook, allowing plugins to access the datamap during destruction.