L L4D2node

CBaseGameStats_Driver::LevelShutdownPreEntity

0x00463550 · 337 bytes · __thiscall

_ZN21CBaseGameStats_Driver22LevelShutdownPreEntityEv

Decompiled

undefined (1 param)

/* CBaseGameStats_Driver::LevelShutdownPreEntity() */

void __thiscall CBaseGameStats_Driver::LevelShutdownPreEntity(CBaseGameStats_Driver *this)

{
  undefined *puVar1;
  char cVar2;
  float local_10;
  
  local_10 = *gpGlobals - *(float *)(this + 0x1318);
  if (local_10 < 0.0) {
    local_10 = 0.0;
    Warning("EVENT_LEVELSHUTDOWN:  with negative elapsed time (rt %f starttime %f)\n",
            (double)*gpGlobals,(double)*(float *)(this + 0x1318));
  }
  if ((this[0x130f] != (CBaseGameStats_Driver)0x0) && (gpGlobals[0x12] != 4.2039e-45)) {
    *(int *)(this + 0x12e0) = *(int *)(this + 0x12e0) + 1;
    puVar1 = gamestats;
    *(float *)(this + 0x12dc) = *(float *)(this + 0x12dc) + local_10;
    (**(code **)(*(int *)puVar1 + 0x20))(puVar1,local_10);
    cVar2 = (*(code *)**(undefined4 **)gamestats)(gamestats);
    if (cVar2 == '\0') {
      CollectData(this,0);
      cVar2 = (**(code **)(*(int *)gamestats + 8))(gamestats);
      if (cVar2 != '\0') {
        SendData(this);
      }
    }
    else {
      cVar2 = (**(code **)(*(int *)gamestats + 0xbc))(gamestats);
      if (cVar2 != '\0') {
        (**(code **)(*(int *)gamestats + 0xa4))(gamestats,1);
      }
      cVar2 = (**(code **)(*(int *)gamestats + 0xd0))(gamestats);
      if (cVar2 != '\0') {
        (**(code **)(*(int *)gamestats + 0xa8))(gamestats);
      }
    }
    this[0x130f] = (CBaseGameStats_Driver)0x0;
  }
  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)