L L4D2node

CEntitySaveRestoreBlockHandler::Save

0x004ab000 · 379 bytes · __thiscall

_ZN30CEntitySaveRestoreBlockHandler4SaveEP5ISave

Decompiled

undefined (2 params)

/* CEntitySaveRestoreBlockHandler::Save(ISave*) */

void __thiscall
CEntitySaveRestoreBlockHandler::Save(CEntitySaveRestoreBlockHandler *this,ISave *param_1)

{
  uint uVar1;
  int *piVar2;
  int *piVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  undefined *puVar7;
  int iVar8;
  CEntitySaveRestoreBlockHandler *pCVar9;
  int local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  iVar4 = (**(code **)(*(int *)param_1 + 0xbc))(param_1);
  if (0 < *(int *)(iVar4 + 0x55c)) {
    local_30 = 0;
    do {
      iVar8 = local_30 * 0x38 + *(int *)(iVar4 + 0x560);
      uVar5 = (**(code **)(*(int *)param_1 + 0xc))(param_1);
      *(undefined4 *)(iVar8 + 0x18) = 0;
      puVar7 = g_pEntityList;
      *(undefined4 *)(iVar8 + 0x14) = uVar5;
      uVar1 = *(uint *)(iVar8 + 0x10);
      if ((((uVar1 != 0xffffffff) &&
           (puVar7 = puVar7 + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
         (piVar2 = *(int **)(puVar7 + 4), piVar2 != (int *)0x0)) {
        iVar6 = (**(code **)(*piVar2 + 0xa4))(piVar2);
        piVar3 = mdlcache;
        if (-1 < iVar6) {
          (**(code **)(*mdlcache + 0x68))(mdlcache);
          *(int **)(iVar4 + 0x564) = piVar2;
                    /* try { // try from 004ab0d8 to 004ab125 has its CatchHandler @ 004ab188 */
          (**(code **)(*piVar2 + 0xc4))(piVar2,param_1);
          *(undefined4 *)(iVar4 + 0x564) = 0;
          iVar6 = (**(code **)(*(int *)param_1 + 0xc))(param_1);
          *(int *)(iVar8 + 0x18) = iVar6 - *(int *)(iVar8 + 0x14);
          *(int *)(iVar8 + 0x20) = piVar2[0x1f];
          *(int *)(iVar8 + 0x24) = piVar2[0x20];
          uVar5 = (**(code **)(*piVar2 + 0x1c))(piVar2);
          pCVar9 = this;
          ModelSpaceLandmark((int)&local_28);
          *(undefined4 *)(iVar8 + 0x28) = local_28;
          *(undefined4 *)(iVar8 + 0x2c) = local_24;
          *(undefined4 *)(iVar8 + 0x30) = local_20;
          if (piVar2[0xc] != 0) {
            iVar6 = piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
            if ((0 < iVar6) && (iVar6 <= *(int *)(gpGlobals + 0x14))) {
              *(uint *)(iVar8 + 0x1c) = *(uint *)(iVar8 + 0x1c) | 0x80000000;
            }
          }
          (**(code **)(*piVar3 + 0x6c))(piVar3,pCVar9,uVar5);
        }
      }
      local_30 = local_30 + 1;
    } while (local_30 < *(int *)(iVar4 + 0x55c));
  }
  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)