L L4D2node

CInstancedSceneEntity::DoThink

0x00811940 · 458 bytes · __thiscall

_ZN21CInstancedSceneEntity7DoThinkEf

Decompiled

undefined (2 params)

/* CInstancedSceneEntity::DoThink(float) */

void __thiscall CInstancedSceneEntity::DoThink(CInstancedSceneEntity *this,float param_1)

{
  uint uVar1;
  char cVar2;
  undefined *puVar3;
  float fVar4;
  
  (**(code **)(*(int *)this + 0x348))(this);
  if (0.0 < *(float *)(this + 0x720)) {
    fVar4 = *(float *)(this + 0x720) - param_1;
    if (fVar4 <= 0.0) {
      fVar4 = 0.0;
    }
    *(float *)(this + 0x720) = fVar4;
    (**(code **)(*(int *)this + 0x354))(this);
    if (this[0x494] == (CInstancedSceneEntity)0x0) {
      return;
    }
  }
  if (((*(CChoreoScene **)(this + 0x4f0) == (CChoreoScene *)0x0) ||
      (this[0x494] == (CInstancedSceneEntity)0x0)) ||
     ((this[0x718] != (CInstancedSceneEntity)0x0 &&
      ((((uVar1 = *(uint *)(this + 0x714), uVar1 == 0xffffffff ||
         (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
        (*(uint *)(puVar3 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar3 + 4) == 0)))))) {
    UTIL_Remove((CBaseEntity *)this);
    return;
  }
  fVar4 = *(float *)(this + 0x4a8);
  if (fVar4 <= 0.25) {
    fVar4 = 0.25;
  }
  if (2.5 <= fVar4) {
    fVar4 = 2.5;
  }
  *(float *)(this + 0x4a8) = fVar4;
  if (this[0x495] == (CInstancedSceneEntity)0x0) {
    if (CSceneEntity::m_pcvSndMixahead == 0) {
      fVar4 = 0.1;
    }
    else {
      fVar4 = *(float *)(*(int *)(CSceneEntity::m_pcvSndMixahead + 0x1c) + 0x2c);
    }
    CChoreoScene::SetSoundFileStartupLatency(*(CChoreoScene **)(this + 0x4f0),fVar4);
    CChoreoScene::Think(*(CChoreoScene **)(this + 0x4f0),*(float *)(this + 0x49c));
    CSceneEntity::SetCurrentTime
              ((CSceneEntity *)this,param_1 * *(float *)(this + 0x4a8) + *(float *)(this + 0x49c),
               false);
    cVar2 = CChoreoScene::SimulationFinished(*(CChoreoScene **)(this + 0x4f0));
    if (cVar2 == '\0') {
      return;
    }
    (**(code **)(*(int *)this + 0x338))(this,0,0);
    UTIL_Remove((CBaseEntity *)this);
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x00811b11. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x340))();
  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)