L L4D2node

CBaseEntity::CheckHasThinkFunction

0x0040e490 · 134 bytes · __thiscall

_ZN11CBaseEntity21CheckHasThinkFunctionEb

Decompiled

undefined (2 params)

/* CBaseEntity::CheckHasThinkFunction(bool) */

void __thiscall CBaseEntity::CheckHasThinkFunction(CBaseEntity *this,bool param_1)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  
  uVar2 = *(uint *)(this + 0x14c);
  if ((uVar2 & 0x400000) == 0) {
    if ((!param_1) && (*(int *)(this + 0xd0) < 1)) {
      if (*(int *)(this + 0xb0) < 1) {
LAB_0040e518:
        *(uint *)(this + 0x14c) = uVar2 | 0x400000;
      }
      else if (*(int *)(*(int *)(this + 0xa4) + 0xc) < 1) {
        iVar3 = 0;
        iVar4 = *(int *)(this + 0xa4);
        do {
          iVar3 = iVar3 + 1;
          if (iVar3 == *(int *)(this + 0xb0)) goto LAB_0040e518;
          piVar1 = (int *)(iVar4 + 0x20);
          iVar4 = iVar4 + 0x14;
        } while (*piVar1 < 1);
      }
    }
  }
  else if (param_1) {
    *(uint *)(this + 0x14c) = uVar2 & 0xffbfffff;
    SimThink_EntityChanged(this);
    return;
  }
  SimThink_EntityChanged(this);
  return;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)