L L4D2node

CMathCounter::Spawn

0x006e7890 · 125 bytes · __thiscall

_ZN12CMathCounter5SpawnEv

Decompiled

undefined (1 param)

/* CMathCounter::Spawn() */

void __thiscall CMathCounter::Spawn(CMathCounter *this)

{
  float fVar1;
  float fVar2;
  float local_10 [3];
  
  local_10[0] = *(float *)(this + 0x444);
  fVar1 = *(float *)(this + 0x440);
  fVar2 = fVar1;
  if (local_10[0] < fVar1) {
    *(float *)(this + 0x444) = fVar1;
    *(float *)(this + 0x440) = local_10[0];
    fVar2 = local_10[0];
    local_10[0] = fVar1;
  }
  if ((fVar2 != 0.0) || (local_10[0] != 0.0)) {
    fVar1 = *(float *)(this + 0x44c);
    if ((fVar1 <= local_10[0]) && (local_10[0] = fVar2, fVar2 <= fVar1)) {
      local_10[0] = fVar1;
    }
    variant_t::Set((variant_t *)(this + 0x44c),1,local_10);
  }
  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)