L L4D2node

CHostState::State_Run

0x00183310 · 336 bytes · __thiscall

_ZN10CHostState9State_RunEf

Decompiled

undefined (2 params)

/* CHostState::State_Run(float) */

void __thiscall CHostState::State_Run(CHostState *this,float param_1)

{
  int *piVar1;
  uint uVar2;
  char cVar3;
  undefined4 uVar4;
  uint uVar5;
  int iVar6;
  float fVar7;
  
  if ((0.0 < *(float *)(this + 800)) && (1 < DAT_003b7f64)) {
    if (0 < DAT_003b8080) {
      iVar6 = 0;
      do {
        piVar1 = *(int **)(DAT_003b8074 + iVar6 * 4);
        cVar3 = (**(code **)(*piVar1 + 0x74))(piVar1);
        if (cVar3 != '\0') {
          if (*(float *)(this + 800) <= param_1) {
            fVar7 = 0.0;
          }
          else {
            fVar7 = *(float *)(this + 800) - param_1;
          }
          *(float *)(this + 800) = fVar7;
          break;
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < DAT_003b8080);
    }
    if ((1 < DAT_003b7f64) && (0 < DAT_003b8080)) {
      iVar6 = 0;
      do {
        piVar1 = *(int **)(DAT_003b8074 + iVar6 * 4);
        cVar3 = (**(code **)(*piVar1 + 0x6c))(piVar1);
        if (cVar3 != '\0') {
          if (DAT_003a1730 <= param_1) {
            param_1 = DAT_003a1730;
          }
          break;
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < DAT_003b8080);
    }
  }
  uVar4 = 5;
  if (s_bFirstRunFrame != '\0') {
    s_bFirstRunFrame = '\0';
    uVar4 = 10;
  }
  if (DAT_003b8088 != '\0') {
    BeginWatchdogTimer(uVar4);
  }
  Host_RunFrame(param_1);
  if (DAT_003b8088 != '\0') {
    EndWatchdogTimer();
  }
  uVar2 = *(uint *)(this + 4);
  if (uVar2 < 8) {
    uVar5 = 1 << ((byte)uVar2 & 0x1f);
    if ((uVar5 & 0xe3) != 0) {
      *(undefined4 *)this = 5;
      return;
    }
    if ((uVar5 & 0x10) != 0) {
      return;
    }
    if ((uVar5 & 0xc) != 0) {
      *(uint *)this = uVar2;
      return;
    }
  }
  *(undefined4 *)this = 4;
  *(undefined4 *)(this + 4) = 4;
  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)