CCSPlayer::Spawn
0x0065e080 · 1618 bytes · __thiscall
_ZN9CCSPlayer5SpawnEv
Decompiled
undefined (1 param)
/* CCSPlayer::Spawn() */
void __thiscall CCSPlayer::Spawn(CCSPlayer *this)
{
uint uVar1;
CBaseEdict *pCVar2;
undefined *puVar3;
char cVar4;
undefined4 uVar5;
int iVar6;
CCSPlayer *pCVar7;
uint uVar8;
int *piVar9;
longdouble lVar10;
float fVar11;
code *pcVar12;
char *pcVar13;
undefined1 local_14 [8];
CUtlDict<float,int>::RemoveAll((CUtlDict<float,int> *)(this + 0x2a14));
SetProgressBarTime(this,0.0);
(**(code **)(*(int *)this + 0x564))(this,1);
(**(code **)(*(int *)this + 0x8ac))(this);
CBaseMultiplayerPlayer::Spawn((CBaseMultiplayerPlayer *)this);
CBaseEntity::AddFlag((CBaseEntity *)this,1);
pcVar12 = *(code **)(*(int *)this + 0x254);
uVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
(*pcVar12)(this,uVar5);
if (*(float *)(this + 0x1ff8) != 250.0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x1ff8) = 0x437a0000;
}
CBasePlayer::SetFOV((CBasePlayer *)this,(CBaseEntity *)this,0,0.0,0);
if (this[0x23e0] != (CCSPlayer)0x0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
this[0x23e0] = (CCSPlayer)0x0;
}
if (*(int *)(this + 0x2850) != 0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2850) = 0;
}
if (*(int *)(this + 0x284c) != 0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x284c) = 0;
}
if (*(CHintMessageQueue **)(this + 0x238c) != (CHintMessageQueue *)0x0) {
CHintMessageQueue::Reset(*(CHintMessageQueue **)(this + 0x238c));
}
iVar6 = *(int *)(this + 0x23bc);
*(uint *)(this + 0x2390) = *(uint *)(this + 0x2390) & 0xffffebbd;
if (iVar6 != 8) {
State_Leave(this,iVar6);
State_Enter(this,iVar6);
}
ClearFlashbangScreenFade(this);
if (*(float *)(this + 0x2854) != 1.0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2854) = 0x3f800000;
}
if (*(float *)(this + 0x2848) != 0.0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2848) = 0;
}
*(undefined4 *)(this + 0x2430) = 0;
piVar9 = engine;
*(int *)(this + 0x23e4) = *(int *)(this + 0x23e4) + 1;
cVar4 = (**(code **)(*piVar9 + 8))(piVar9);
if ((((cVar4 == '\0') && (*(char *)(TheNavMesh + 0x4d) != '\0')) &&
(pCVar7 = (CCSPlayer *)UTIL_GetListenServerHost(), this == pCVar7)) &&
(*(int *)(developer._28_4_ + 0x30) != 0)) {
ClientPrint((CBasePlayer *)this,4,
"The Navigation Mesh was built using a different version of this map.",(char *)0x0,
(char *)0x0,(char *)0x0,(char *)0x0);
}
iVar6 = gpGlobals;
this[0x23ec] = (CCSPlayer)0x0;
*(undefined4 *)(this + 0x23e8) = 0;
puVar3 = g_pEntityList;
*(undefined4 *)(this + 0x23b0) = 0x3c;
uVar1 = *(uint *)(this + 0x2894);
*(undefined4 *)(this + 0x23ac) = *(undefined4 *)(iVar6 + 0xc);
if (uVar1 != 0xffffffff) {
uVar8 = uVar1 & 0xfff;
piVar9 = (int *)(puVar3 + uVar8 * 0x10 + 4);
if (piVar9 != (int *)0x0) {
if ((*(uint *)(puVar3 + uVar8 * 0x10 + 8) == uVar1 >> 0xc) &&
(*(CBaseEntity **)(puVar3 + uVar8 * 0x10 + 4) != (CBaseEntity *)0x0)) {
UTIL_Remove(*(CBaseEntity **)(puVar3 + uVar8 * 0x10 + 4));
uVar1 = *(uint *)(this + 0x2894);
if (((uVar1 == 0xffffffff) ||
(piVar9 = (int *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4), piVar9 == (int *)0x0)) ||
(piVar9[1] != uVar1 >> 0xc)) goto LAB_0065e270;
}
else if (*(uint *)(puVar3 + uVar8 * 0x10 + 8) != uVar1 >> 0xc) goto LAB_0065e270;
if (*piVar9 != 0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2894) = 0xffffffff;
}
}
}
LAB_0065e270:
if (this[0x285c] != (CCSPlayer)0x0) {
(**(code **)(*(int *)this + 0x898))(this,this + 0x285c);
this[0x285c] = (CCSPlayer)0x0;
}
fVar11 = *(float *)(gpGlobals + 0xc) + 0.05;
pcVar13 = "CSPushawayThink";
pcVar12 = PushawayThink;
uVar5 = 0;
pCVar7 = this;
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)PushawayThink);
iVar6 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if ((iVar6 != 0) && (((byte)this[0x1d20] & 8) == 0)) {
piVar9 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
(**(code **)(*piVar9 + 0x424))(piVar9,pCVar7,pcVar12,uVar5,fVar11,pcVar13);
fVar11 = *(float *)(gpGlobals + 0xc);
if (fVar11 != *(float *)(this + 0x17dc)) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(float *)(this + 0x17dc) = fVar11;
}
}
*(undefined4 *)(this + 0x2a08) = 0;
if (*(int *)(this + 0x2a38) != 0) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
*(undefined4 *)(this + 0x2a38) = 0;
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x2a38) = 0;
}
}
lVar10 = (longdouble)RandomFloat(0,0x3e4ccccd);
fVar11 = (float)lVar10;
lVar10 = (longdouble)CountdownTimer::Now();
if ((float)lVar10 + fVar11 != *(float *)(this + 0x2a44)) {
(**(code **)(*(int *)(this + 0x2a3c) + 4))(this + 0x2a3c,this + 0x2a44);
*(float *)(this + 0x2a44) = (float)lVar10 + fVar11;
}
if (fVar11 != *(float *)(this + 0x2a40)) {
(**(code **)(*(int *)(this + 0x2a3c) + 4))(this + 0x2a3c,this + 0x2a40);
*(float *)(this + 0x2a40) = fVar11;
}
StockPlayerAmmo(this,(CBaseCombatWeapon *)0x0);
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.