L L4D2node

CBaseEntity::Restore

0x00616500 · 750 bytes · __thiscall

_ZN11CBaseEntity7RestoreER8IRestore

Decompiled

undefined (2 params)

/* CBaseEntity::Restore(IRestore&) */

undefined4 __thiscall CBaseEntity::Restore(CBaseEntity *this,IRestore *param_1)

{
  uint uVar1;
  CBaseEdict *this_00;
  code *pcVar2;
  code *pcVar3;
  char cVar4;
  undefined4 uVar5;
  int iVar6;
  undefined *puVar7;
  float *pfVar8;
  CBaseEntity **ppCVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  CBaseEntity *local_58;
  CBaseEntity *local_50;
  char *local_20 [4];
  
  local_50 = (CBaseEntity *)0x616520;
  CCollisionProperty::DestroyPartitionHandle((CCollisionProperty *)(this + 0x194));
  local_50 = (CBaseEntity *)0x616528;
  (**(code **)(*(int *)this + 0x30))();
  local_50 = (CBaseEntity *)0x616538;
  uVar5 = (**(code **)(*(int *)param_1 + 8))();
  local_50 = (CBaseEntity *)0x616546;
  iVar6 = (**(code **)(*(int *)param_1 + 0x9c))();
  uVar1 = *(uint *)(this + 0x180);
  fVar10 = *(float *)(iVar6 + 0x550);
  fVar11 = *(float *)(iVar6 + 0x554);
  fVar12 = *(float *)(iVar6 + 0x558);
  if ((((uVar1 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
    pfVar8 = (float *)&vec3_origin;
    if (*(int *)(iVar6 + 0x504) != 0) {
      pfVar8 = (float *)(iVar6 + 0x51c);
    }
    fVar10 = fVar10 + *pfVar8;
    fVar11 = fVar11 + pfVar8[1];
    fVar12 = fVar12 + pfVar8[2];
  }
  local_50 = (CBaseEntity *)0x6165e2;
  MatrixSetColumn((Vector *)(this + 0x2e0),3,(matrix3x4_t *)(this + 0x28c));
  fVar10 = fVar10 + *(float *)(this + 0x39c);
  fVar11 = fVar11 + *(float *)(this + 0x3a0);
  fVar12 = fVar12 + *(float *)(this + 0x3a4);
  if (((*(float *)(this + 0x39c) != fVar10) || (*(float *)(this + 0x3a0) != fVar11)) ||
     (*(float *)(this + 0x3a4) != fVar12)) {
    if (this[0x6c] == (CBaseEntity)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        local_50 = (CBaseEntity *)0x6166ff;
        iVar6 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar6 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x39c) = fVar10;
    *(float *)(this + 0x3a0) = fVar11;
    *(float *)(this + 0x3a4) = fVar12;
  }
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) & 0xffff7fff;
  local_50 = (CBaseEntity *)0x61664b;
  CCollisionProperty::MarkSurroundingBoundsDirty((CCollisionProperty *)(this + 0x194));
  ppCVar9 = (CBaseEntity **)&stack0xffffffb4;
  if (*(int *)(this + 0x30) != 0) {
    local_50 = (CBaseEntity *)0x61665a;
    iVar6 = (**(code **)(*(int *)this + 0x1c))();
    ppCVar9 = (CBaseEntity **)&stack0xffffffb4;
    if (iVar6 != 0) {
      local_50 = (CBaseEntity *)0x616747;
      (**(code **)(*(int *)this + 0x20))();
      ppCVar9 = &local_50;
      if (local_20[0] != (char *)0x0) {
        local_50 = (CBaseEntity *)param_1;
                    /* try { // try from 0061675a to 0061675f has its CatchHandler @ 00616809 */
        cVar4 = (**(code **)(*(int *)param_1 + 0x98))();
        ppCVar9 = &local_50;
        if (cVar4 != '\0') {
          local_50 = (CBaseEntity *)local_20;
          (**(code **)(*(int *)this + 0x20))();
          if (local_20[0] == (char *)0x0) {
            local_20[0] = "";
          }
          local_58 = (CBaseEntity *)0x61678c;
          PrecacheModel(local_20[0]);
          pcVar2 = *(code **)(*(int *)this + 0x24);
          pcVar3 = *(code **)(*(int *)modelinfo + 0xc);
          local_50 = this;
          local_58 = (CBaseEntity *)0x6167ab;
          (**(code **)(*(int *)this + 0x20))();
          ppCVar9 = &local_58;
          local_58 = modelinfo;
          (*pcVar3)();
          local_58 = this;
          (*pcVar2)();
        }
      }
    }
  }
  uVar1 = *(uint *)(this + 600);
  if (((uVar1 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (iVar6 = *(int *)(puVar7 + 4), iVar6 != 0)))) {
    ppCVar9[1] = this;
    *ppCVar9 = (CBaseEntity *)iVar6;
    ppCVar9[-1] = (CBaseEntity *)0x6167f7;
    AddEntityToGroundList(*ppCVar9,ppCVar9[1]);
  }
  if (((byte)this[0xd4] & 8) != 0) {
    ppCVar9[1] = (CBaseEntity *)0x8;
    *ppCVar9 = this;
    ppCVar9[-1] = (CBaseEntity *)0x6166ac;
    AddEffects(*ppCVar9,(int)ppCVar9[1]);
  }
  return uVar5;
}

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)