L L4D2node

CCSPlayer::SelectSpawnSpot

0x00659a90 · 293 bytes · __thiscall

_ZN9CCSPlayer15SelectSpawnSpotEPKcRP11CBaseEntity

Decompiled

undefined (3 params)

/* CCSPlayer::SelectSpawnSpot(char const*, CBaseEntity*&) */

undefined4 __thiscall
CCSPlayer::SelectSpawnSpot(CCSPlayer *this,char *param_1,CBaseEntity **param_2)

{
  char cVar1;
  CBaseEntity *pCVar2;
  CBaseEntity *this_00;
  CBaseEntity *pCVar3;
  
  pCVar2 = (CBaseEntity *)
           CGlobalEntityList::FindEntityByClassname((CGlobalEntityList *)gEntList,*param_2,param_1);
  *param_2 = pCVar2;
  pCVar3 = pCVar2;
  if (pCVar2 == (CBaseEntity *)0x0) {
    pCVar2 = (CBaseEntity *)
             CGlobalEntityList::FindEntityByClassname
                       ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,param_1);
    *param_2 = pCVar2;
    pCVar3 = pCVar2;
  }
  do {
    this_00 = (CBaseEntity *)0x0;
    if (pCVar2 == (CBaseEntity *)0x0) {
LAB_00659b28:
      pCVar2 = (CBaseEntity *)
               CGlobalEntityList::FindEntityByClassname
                         ((CGlobalEntityList *)gEntList,this_00,param_1);
      *param_2 = pCVar2;
    }
    else {
      cVar1 = (**(code **)(*g_pGameRules + 0x124))(g_pGameRules,pCVar2,this);
      this_00 = *param_2;
      if (cVar1 == '\0') goto LAB_00659b28;
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      if (((*(float *)(this_00 + 0x2e0) != 0.0) || (*(float *)(this_00 + 0x2e4) != 0.0)) ||
         (*(float *)(this_00 + 0x2e8) != 0.0)) {
        return 1;
      }
      pCVar2 = (CBaseEntity *)
               CGlobalEntityList::FindEntityByClassname
                         ((CGlobalEntityList *)gEntList,*param_2,param_1);
      *param_2 = pCVar2;
    }
    if (pCVar3 == pCVar2) {
      DevMsg("CCSPlayer::SelectSpawnSpot: couldn\'t find valid spawn point.\n");
      return 1;
    }
  } 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)