sdkhooks: Allow overriding SDKHook_Think (#1397)

* Allow to block Think()

* Update SDKHookCB comment
This commit is contained in:
Einyux 2021-07-10 21:42:17 +02:00 committed by GitHub
parent fdfb8837d1
commit 823b55c22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1458,7 +1458,11 @@ void SDKHooks::Hook_StartTouchPost(CBaseEntity *pOther)
void SDKHooks::Hook_Think() void SDKHooks::Hook_Think()
{ {
Call(META_IFACEPTR(CBaseEntity), SDKHook_Think); cell_t result = Call(META_IFACEPTR(CBaseEntity), SDKHook_Think);
if(result >= Pl_Handled)
RETURN_META(MRES_SUPERCEDE);
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }

View File

@ -237,11 +237,12 @@ typeset SDKHookCB
function void (int client); function void (int client);
// Spawn // Spawn
// Think
function Action (int entity); function Action (int entity);
// GroundEntChanged // GroundEntChanged
// SpawnPost // SpawnPost
// Think/Post // ThinkPost
// VPhysicsUpdate/Post // VPhysicsUpdate/Post
function void (int entity); function void (int entity);