L L4D2node

CEntitySaveRestoreBlockHandler::DoRestoreEntity

0x004aae60 · 215 bytes · __thiscall

_ZN30CEntitySaveRestoreBlockHandler15DoRestoreEntityEP11CBaseEntityP8IRestore

Decompiled

undefined (3 params)

/* CEntitySaveRestoreBlockHandler::DoRestoreEntity(CBaseEntity*, IRestore*) */

bool __thiscall
CEntitySaveRestoreBlockHandler::DoRestoreEntity
          (CEntitySaveRestoreBlockHandler *this,CBaseEntity *param_1,IRestore *param_2)

{
  int *piVar1;
  uint *puVar2;
  int iVar3;
  uint uVar4;
  undefined *puVar5;
  bool bVar6;
  uint local_20;
  
  piVar1 = mdlcache;
  (**(code **)(*mdlcache + 0x68))(mdlcache);
  if (param_1 == (CBaseEntity *)0x0) {
    local_20 = 0xffffffff;
  }
  else {
                    /* try { // try from 004aae8a to 004aaedd has its CatchHandler @ 004aaf44 */
    puVar2 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_20 = *puVar2;
  }
  iVar3 = (**(code **)(*(int *)param_2 + 0x9c))(param_2);
  *(CBaseEntity **)(iVar3 + 0x564) = param_1;
  (**(code **)(*(int *)param_1 + 200))(param_1,param_2);
  iVar3 = (**(code **)(*(int *)param_2 + 0x9c))(param_2);
  *(undefined4 *)(iVar3 + 0x564) = 0;
  uVar4 = (**(code **)(*(int *)param_1 + 0xa4))(param_1);
  if ((uVar4 & 1) == 0) {
                    /* try { // try from 004aaf20 to 004aaf22 has its CatchHandler @ 004aaf44 */
    (**(code **)(*(int *)param_1 + 0x6c))(param_1);
  }
  else {
    (**(code **)(*(int *)param_1 + 100))();
  }
  if (local_20 != 0xffffffff) {
    puVar5 = g_pEntityList + (local_20 & 0xfff) * 0x10;
    if ((puVar5 != (undefined *)0xfffffffc) && (*(uint *)(puVar5 + 8) == local_20 >> 0xc)) {
      bVar6 = *(int *)(puVar5 + 4) != 0;
      goto LAB_004aaf0a;
    }
  }
  bVar6 = false;
LAB_004aaf0a:
  (**(code **)(*piVar1 + 0x6c))(piVar1);
  return bVar6;
}

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)