L L4D2node

CSprite::OnRestore

0x004c21c0 · 461 bytes · __thiscall

_ZN7CSprite9OnRestoreEv

Decompiled

undefined (1 param)

/* CSprite::OnRestore() */

void __thiscall CSprite::OnRestore(CSprite *this)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  CBaseEntity *pCVar4;
  int iVar5;
  undefined4 *puVar6;
  undefined *puVar7;
  
  CBaseEntity::OnRestore((CBaseEntity *)this);
  iVar3 = CBaseEntity::GetFollowedEntity((CBaseEntity *)this);
  if (iVar3 == 0) {
    uVar1 = *(uint *)(this + 0x440);
    if ((((uVar1 == 0xffffffff) ||
         (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
        (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
      iVar3 = *(int *)(this + 0x444);
    }
    else {
      if (this[0x6c] == (CSprite)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSprite)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x440) = 0xffffffff;
      iVar3 = *(int *)(this + 0x444);
    }
    if (iVar3 != 0) {
      if (this[0x6c] == (CSprite)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSprite)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x444) = 0;
    }
  }
  else {
    iVar3 = *(int *)(this + 0x444);
    pCVar4 = (CBaseEntity *)CBaseEntity::GetFollowedEntity((CBaseEntity *)this);
    if (pCVar4 != (CBaseEntity *)0x0) {
      uVar1 = *(uint *)(this + 0x440);
      if (((uVar1 == 0xffffffff) ||
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
         ((*(uint *)(puVar7 + 8) != uVar1 >> 0xc || (pCVar4 != *(CBaseEntity **)(puVar7 + 4))))) {
        if (this[0x6c] == (CSprite)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CSprite)((byte)this[0x70] | 1);
        }
        puVar6 = (undefined4 *)(**(code **)(*(int *)pCVar4 + 0xc))(pCVar4);
        *(undefined4 *)(this + 0x440) = *puVar6;
      }
      if (iVar3 != *(int *)(this + 0x444)) {
        if (this[0x6c] == (CSprite)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CSprite)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x444) = iVar3;
      }
      CBaseEntity::FollowEntity((CBaseEntity *)this,pCVar4,true);
    }
  }
  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)