Take into account the returned value in SDKHook_Think callbacks#1397
Take into account the returned value in SDKHook_Think callbacks#1397KyleSanderson merged 2 commits intoalliedmodders:masterfrom einyux:feature-sdk-think
Conversation
|
It must be noticed that SDKHook_Think doesn't seem to be the only case.
have the same issue. It should be let to the user the possibility to block any game call in pre-hooks (At his own risk...), or else put in the documentation that for these cases the return value is discarded (For security purposes...). |
|
this seems fine to me outside of the crunched style. WDYT? EDIT: Github styling was not expected. |
|
@asherkin do you know the implications of what happens when an entity stops thinking by chance? |
I do not, but it'll be entity-specific and should generally be fine.
It is in the documentation, That'll need updating for this change as well. |
|
@asherkin Indeed, I missed the callback prototype. Thinking about it now, but will it not break the compatibility with some plugins (And are we okay with this)...? By the way, what's your opinion about doing the same thing for the three following hooks:
|
|
I updated sdkhooks.inc. Let's see for other hooks later. |

To disable entirely the call of "EntityX::Think()", using the property "m_nNextThinkTick" is enough.
But sometimes I want to use the "EntityX::Think()" to do something else, i.e. to replace it with my own code.
In SDKHook_Think callbacks, the returned value need to be taken into account to do this.