L L4D2node

CTerrorPlayerResource::Spawn

0x009f2b00 · 2341 bytes · __thiscall

_ZN21CTerrorPlayerResource5SpawnEv

Decompiled

undefined (1 param)

/* CTerrorPlayerResource::Spawn() */

void __thiscall CTerrorPlayerResource::Spawn(CTerrorPlayerResource *this)

{
  float fVar1;
  CBaseEdict *pCVar2;
  CTerrorPlayerResource CVar3;
  int iVar4;
  int iVar5;
  int local_34;
  CTerrorPlayerResource *local_30;
  undefined4 local_20 [4];
  
  iVar5 = 0;
  local_34 = 0;
  local_30 = this;
  do {
    local_20[0] = 0;
    iVar4 = memcmp(this + iVar5 + 0x8e8,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0x8e8) = 0;
    }
    local_20[0] = 0;
    iVar4 = memcmp(this + iVar5 + 0x96c,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0x96c) = 0;
    }
    local_20[0] = 0;
    iVar4 = memcmp(this + iVar5 + 0x9f0,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0x9f0) = 0;
    }
    local_20[0] = 0;
    iVar4 = memcmp(this + iVar5 + 0xa74,local_20,4);
    if (iVar4 == 0) {
      if (local_30[0xaf8] == (CTerrorPlayerResource)0x0) goto LAB_009f2c00;
LAB_009f2f07:
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      this[local_34 + 0xaf8] = (CTerrorPlayerResource)0x0;
      if (local_30[0xb19] != (CTerrorPlayerResource)0x0) goto LAB_009f2f47;
LAB_009f2c10:
      CVar3 = local_30[0xb3a];
    }
    else {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xa74) = 0;
      if (local_30[0xaf8] != (CTerrorPlayerResource)0x0) goto LAB_009f2f07;
LAB_009f2c00:
      if (local_30[0xb19] == (CTerrorPlayerResource)0x0) goto LAB_009f2c10;
LAB_009f2f47:
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      this[local_34 + 0xb19] = (CTerrorPlayerResource)0x0;
      CVar3 = local_30[0xb3a];
    }
    if (CVar3 != (CTerrorPlayerResource)0x0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      this[local_34 + 0xb3a] = (CTerrorPlayerResource)0x0;
    }
    local_20[0] = 0xffffffff;
    iVar4 = memcmp(this + iVar5 + 0xb5c,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xb5c) = 0xffffffff;
    }
    local_20[0] = 0xffffffff;
    iVar4 = memcmp(this + iVar5 + 0xbe0,local_20,4);
    if (iVar4 == 0) {
      CVar3 = local_30[0xc64];
    }
    else {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xbe0) = 0xffffffff;
      CVar3 = local_30[0xc64];
    }
    if (CVar3 != (CTerrorPlayerResource)0x0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      this[local_34 + 0xc64] = (CTerrorPlayerResource)0x0;
    }
    local_20[0] = 0xbf800000;
    iVar4 = memcmp(this + iVar5 + 0xd0c,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xd0c) = 0xbf800000;
    }
    local_20[0] = 0xffffffff;
    iVar4 = memcmp(this + iVar5 + 0xd90,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xd90) = 0xffffffff;
    }
    local_20[0] = 0;
    iVar4 = memcmp(this + iVar5 + 0xe14,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + iVar5 + 0xe14) = 0;
    }
    local_34 = local_34 + 1;
    iVar5 = iVar5 + 4;
    local_30 = local_30 + 1;
    if (iVar5 == 0x84) {
      if (this[0xea4] != (CTerrorPlayerResource)0x0) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        this[0xea4] = (CTerrorPlayerResource)0x0;
      }
      if (*(float *)(this + 0xe98) == 0.0) {
        fVar1 = *(float *)(this + 0xe9c);
      }
      else {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        fVar1 = *(float *)(this + 0xe9c);
        *(undefined4 *)(this + 0xe98) = 0;
      }
      if (fVar1 == 0.0) {
        iVar5 = *(int *)(this + 0xea0);
      }
      else {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0xe9c) = 0;
        iVar5 = *(int *)(this + 0xea0);
      }
      if (iVar5 == 0) {
        CVar3 = this[0xea5];
      }
      else {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        CVar3 = this[0xea5];
        *(undefined4 *)(this + 0xea0) = 0;
      }
      if (CVar3 == (CTerrorPlayerResource)0x0) {
        iVar5 = *(int *)(this + 0xea8);
      }
      else {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        iVar5 = *(int *)(this + 0xea8);
        this[0xea5] = (CTerrorPlayerResource)0x0;
      }
      if (iVar5 != 0) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0xea8) = 0;
      }
      if (*(int *)(this + 0xeac) != 0) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0xeac) = 0;
      }
      if (*(int *)(this + 0xeb0) != 0) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0xeb0) = 0;
      }
      CVar3 = (CTerrorPlayerResource)CDirector::HasAnySurvivorLeftSafeArea(TheDirector);
      if (CVar3 != this[0xeb4]) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        this[0xeb4] = CVar3;
      }
      CVar3 = *(CTerrorPlayerResource *)(*(int *)(TheDirector + 0x634) + 0x28);
      if (CVar3 != this[0xeb5]) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        this[0xeb5] = CVar3;
      }
      if (*(int *)(this + 0xeb8) != 0) {
        if (this[0x6c] == (CTerrorPlayerResource)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] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0xeb8) = 0;
      }
      if (*(int *)(this + 0xebc) == 0) {
        CPlayerResource::Spawn((CPlayerResource *)this);
        return;
      }
      if (this[0x6c] == (CTerrorPlayerResource)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
        *(undefined4 *)(this + 0xebc) = 0;
      }
      else {
        this[0x70] = (CTerrorPlayerResource)((byte)this[0x70] | 1);
        *(undefined4 *)(this + 0xebc) = 0;
      }
      CPlayerResource::Spawn((CPlayerResource *)this);
      return;
    }
  } while( true );
}

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)