L L4D2node

SaveEntityOnTable

0x004aacf0 · 161 bytes · __cdecl

_Z17SaveEntityOnTableP11CBaseEntityP16CSaveRestoreDataRi

Decompiled

undefined (3 params)

/* SaveEntityOnTable(CBaseEntity*, CSaveRestoreData*, int&) */

void SaveEntityOnTable(CBaseEntity *param_1,CSaveRestoreData *param_2,int *param_3)

{
  int iVar1;
  int *piVar2;
  int *piVar3;
  int local_20 [4];
  
  piVar3 = (int *)(*param_3 * 0x38 + *(int *)(param_2 + 0x578));
  *piVar3 = *param_3;
  iVar1 = (**(code **)(*(int *)param_1 + 0xdc))(param_1);
  piVar3[1] = iVar1;
  (**(code **)(*(int *)param_1 + 0x20))(local_20,param_1);
  piVar3[3] = -1;
  piVar3[0xd] = local_20[0];
  if (*(int *)(param_1 + 0x30) == 0) {
    iVar1 = 0;
  }
  else {
    iVar1 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  piVar3[2] = iVar1;
  piVar2 = (int *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
  iVar1 = *piVar2;
  piVar3[7] = 0;
  piVar3[5] = 0;
  piVar3[6] = 0;
  piVar3[8] = 0;
  piVar3[4] = iVar1;
  *param_3 = *param_3 + 1;
  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)