L L4D2node

CBasePlayer::SharedSpawn

0x00419860 · 1260 bytes · __thiscall

_ZN11CBasePlayer11SharedSpawnEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBasePlayer::SharedSpawn() */

void __thiscall CBasePlayer::SharedSpawn(CBasePlayer *this)

{
  float fVar1;
  CBaseEdict *pCVar2;
  int *piVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (___atan2f_finite == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_34,0,0,0,0,
               "/data/src/game/server/../../game/shared/baseplayer_shared.cpp",0x756,
               &SharedSpawn()::tm_fmt,"(%s)%s","Unaccounted","CBasePlayer::SharedSpawn");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00419b96 to 00419be4 has its CatchHandler @ 00419db6 */
    iVar6 = ThreadGetCurrentId();
    if (iVar5 == iVar6) {
      if ((char *)*_DAT_0105d15c != "CBasePlayer::SharedSpawn") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0a676,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 00419927 to 00419ab1 has its CatchHandler @ 00419d89 */
  CBaseEntity::SetMoveType((CBaseEntity *)this,2,0);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 0x10));
  CBaseEntity::SetFriction((CBaseEntity *)this,1.0);
  if (this[0x1c80] != (CBasePlayer)0x0) {
    (**(code **)(*(int *)(this + 0x1c7c) + 4))(this + 0x1c7c,this + 0x1c80);
    this[0x1c80] = (CBasePlayer)0x0;
  }
  if (this[0x104] != (CBasePlayer)0x0) {
                    /* try { // try from 00419c8f to 00419d4a has its CatchHandler @ 00419d89 */
    (**(code **)(*(int *)this + 0x21c))(this,this + 0x104);
    this[0x104] = (CBasePlayer)0x0;
  }
  if (*(int *)(this + 0x100) != 100) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(undefined4 *)(this + 0x100) = 100;
  }
  if (this[0x105] != (CBasePlayer)0x2) {
    (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
    this[0x105] = (CBasePlayer)0x2;
  }
  if (this[0x1ac8] != (CBasePlayer)0x1) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1ac8);
    this[0x1ac8] = (CBasePlayer)0x1;
  }
  fVar1 = *(float *)(sv_stepsize._28_4_ + 0x2c);
  if (fVar1 != *(float *)(this + 0x1acc)) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1acc);
    *(float *)(this + 0x1acc) = fVar1;
  }
  if (this[0x1ad0] != (CBasePlayer)0x1) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1ad0);
    this[0x1ad0] = (CBasePlayer)0x1;
  }
  if (this[0x120] != (CBasePlayer)0x0) {
    if (this[0x6c] == (CBasePlayer)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] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    this[0x120] = (CBasePlayer)0x0;
  }
  fVar1 = *(float *)(gpGlobals + 0xc);
  if (fVar1 != *(float *)(this + 0x17dc)) {
    if (this[0x6c] == (CBasePlayer)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] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x17dc) = fVar1;
  }
  if (*(float *)(this + 0x1ff8) != 0.0) {
    if (this[0x6c] == (CBasePlayer)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] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1ff8) = 0;
  }
  piVar3 = mdlcache;
  (**(code **)(*mdlcache + 0x68))(mdlcache);
  if (((byte)this[0x150] & 2) == 0) {
                    /* try { // try from 00419c40 to 00419c65 has its CatchHandler @ 00419daa */
    iVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    CBaseEntity::SetCollisionBounds
              ((CBaseEntity *)this,(Vector *)(iVar6 + 0xc),(Vector *)(iVar5 + 0x18));
  }
  else {
                    /* try { // try from 00419ac9 to 00419b30 has its CatchHandler @ 00419daa */
    iVar5 = (**(code **)(*g_pGameRules + 0x7c))();
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    CBaseEntity::SetCollisionBounds
              ((CBaseEntity *)this,(Vector *)(iVar6 + 0x24),(Vector *)(iVar5 + 0x30));
  }
  if (*(float *)(this + 0x1aa4) != 0.0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1aa4);
    *(undefined4 *)(this + 0x1aa4) = 0;
  }
  CBaseCombatCharacter::SetBloodColor((CBaseCombatCharacter *)this,0);
  (**(code **)(*piVar3 + 0x6c))(piVar3);
  iVar5 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar6 = ThreadGetCurrentId();
    if (iVar5 == iVar6) {
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  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)