While using a CBaseNPC-derived entity with a custom datamap + the behavior system, removing the entity while an Action is running would occasionally throw an error about missing properties from the datamap despite being defined. This is because when an entity is destroyed, the intention interface is deleted after the datamap has been detached from the entity, resulting in reading the wrong datamap. This PR ensures that the NextBot interfaces are destroyed first before the datamap is detached, so that Actions can perform any cleanup and refer to the datamap before destruction.
While using a CBaseNPC-derived entity with a custom datamap + the behavior system, removing the entity while an Action is running would occasionally throw an error about missing properties from the datamap despite being defined. This is because when an entity is destroyed, the intention interface is deleted after the datamap has been detached from the entity, resulting in reading the wrong datamap. This PR ensures that the NextBot interfaces are destroyed first before the datamap is detached, so that Actions can perform any cleanup and refer to the datamap before destruction.