EntityPreHook "touch" crashing

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: EntityPreHook "touch" crashing

Postby L'In20Cible » Sun Jan 22, 2017 1:58 am

Kami wrote:Would there be any drawbacks to this if I just do whatever I need to do in the hook and return False (without the trampoline)? It seems that this solved the crash for me.
It can be, yes. Blocking the call without mimicking what the engine does means that parents won't be noticed (nor networked to clients) so this can break logics in certain cases.
User avatar
Kami
Global Moderator
Posts: 263
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: EntityPreHook "touch" crashing

Postby Kami » Tue Jan 24, 2017 6:20 pm

Would it be possible that returning False in a touch Hook would make any item unpickable? After using this "fix" (not yours, I just tried using return False at the end of the hook) I seem to be unable to pickup any weapon (so at spawn I have none either).
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: EntityPreHook "touch" crashing

Postby L'In20Cible » Wed Jan 25, 2017 12:31 am

Totally. If you return False, the engine's code won't be executed. And since you need to touch the weapons to pick them up... I assume the pickup is handled by the m_pfnTouch function.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Bing [Bot] and 25 guests