I'm trying to detach a child entity from the parent entity before the parent entity gets removed.
Is it possible to prehook entity kill/remove?
[HL2DM] Prehooking entity kill
Re: [HL2DM] Prehooking entity kill
I am not sure if this gets called before or after the entity is actually removed, but you can try and test it yourself:
http://wiki.sourcepython.com/developing ... itydeleted
If that doesn't work, you can always use an EntityPreHook on remove.
http://wiki.sourcepython.com/developing ... itydeleted
If that doesn't work, you can always use an EntityPreHook on remove.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: [HL2DM] Prehooking entity kill
OnEntityDeleted is called before, giving you full access to the index/Entity instance. 
As a side note, OnEntityCreated was firing too early, before the networkable instance being linked to the edict (making our conversions crying) thus why we manually link it before calling the registered callbacks: https://github.com/Source-Python-Dev-Te ... n.cpp#L496

As a side note, OnEntityCreated was firing too early, before the networkable instance being linked to the edict (making our conversions crying) thus why we manually link it before calling the registered callbacks: https://github.com/Source-Python-Dev-Te ... n.cpp#L496
Re: [HL2DM] Prehooking entity kill
OnEntityDeleted works great. Thanks guys!
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 90 guests