L L4D2node

CBaseEntity::PhysicsDispatchThink

0x0078d600 · 738 bytes · __cdecl

_ZN11CBaseEntity20PhysicsDispatchThinkEMS_FvvE

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseEntity::PhysicsDispatchThink(void (CBaseEntity::*)()) */

void CBaseEntity::PhysicsDispatchThink(_func_void *param_1)

{
  float fVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  int *piVar6;
  undefined1 *puVar7;
  char *pcVar8;
  longdouble lVar9;
  code *in_stack_00000008;
  int in_stack_0000000c;
  float local_34;
  float local_20;
  
  pcVar8 = "CBaseEntity::PhysicsDispatchThink";
  if (*(int *)(vprof_scope_entity_thinks._28_4_ + 0x30) != 0) {
    piVar6 = (int *)EntityFactoryDictionary();
    puVar7 = &DAT_00d539c2;
    if (*(int *)(param_1 + 0x7c) != 0) {
      puVar7 = *(undefined1 **)(param_1 + 0x7c);
    }
    pcVar8 = (char *)(**(code **)(*piVar6 + 0x10))(piVar6,puVar7);
  }
  iVar3 = _DAT_0105db00;
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar3 == iVar4)) {
    if (pcVar8 != (char *)*_DAT_0105d15c) {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,(int)pcVar8,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  local_20 = *(float *)(think_limit._28_4_ + 0x2c);
  iVar3 = (**(code **)(_g_pVCR + 0xc))();
  if (iVar3 == 0) {
    iVar3 = IsDormant((CBaseEntity *)param_1);
  }
  else {
    local_20 = 0.0;
    iVar3 = IsDormant((CBaseEntity *)param_1);
  }
  if (iVar3 != 0) {
    uVar5 = GetDebugName((CBaseEntity *)param_1);
    puVar7 = &DAT_00d539c2;
    if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
      puVar7 = *(undefined1 **)(param_1 + 0x7c);
    }
    Warning("Dormant entity %s (%s) is thinking!!\n",puVar7,uVar5);
  }
  if (local_20 == 0.0) {
    local_34 = 0.0;
  }
  else {
    lVar9 = (longdouble)Plat_FloatTime();
    local_34 = (float)lVar9;
  }
  if (in_stack_00000008 != (code *)0x0) {
    if (((uint)in_stack_00000008 & 1) != 0) {
      in_stack_00000008 = *(code **)(in_stack_00000008 + *(int *)(param_1 + in_stack_0000000c) + -1)
      ;
    }
    (*in_stack_00000008)(param_1 + in_stack_0000000c);
  }
  if (local_20 != 0.0) {
    lVar9 = (longdouble)Plat_FloatTime();
    fVar1 = ((float)lVar9 - local_34) * 1000.0;
    if (local_20 < fVar1) {
      if (*(int *)(vprof_think_limit._28_4_ + 0x30) != 0) {
        g_VProfSignalSpike = 1;
      }
      piVar6 = (int *)MyNPCPointer();
      if ((piVar6 == (int *)0x0) || (piVar6[0x692] == 0)) {
        puVar7 = &DAT_00d539c2;
        if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
          puVar7 = *(undefined1 **)(param_1 + 0x7c);
        }
        Msg("%s(%s) thinking for %.02f ms!!!\n",puVar7,"P11CBaseEntity",(double)fVar1);
      }
      else {
        (**(code **)(*piVar6 + 0x988))(piVar6,fVar1);
      }
    }
  }
  iVar3 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar3 == iVar4)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    return;
  }
  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)