CTerrorGameRules::PlayerSpawn
0x00504670 · 900 bytes · __thiscall
_ZN16CTerrorGameRules11PlayerSpawnEP11CBasePlayer
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorGameRules::PlayerSpawn(CBasePlayer*) */
void __thiscall CTerrorGameRules::PlayerSpawn(CTerrorGameRules *this,CBasePlayer *param_1)
{
CBaseEdict *pCVar1;
char cVar2;
int iVar3;
int iVar4;
char *pcVar5;
int *local_44;
undefined4 local_40;
undefined **local_3c;
undefined4 local_38;
int local_34;
if ((param_1 == (CBasePlayer *)0x0) ||
(cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar2 == '\0')) {
param_1 = (CBasePlayer *)0x0;
Error("PlayerSpawn");
iVar4 = iRam000023bc;
}
else {
iVar4 = *(int *)(param_1 + 0x23bc);
}
if (iVar4 != 0) {
return;
}
CBasePlayer::SetArmorValue(param_1,0);
if (param_1[0x2429] != (CBasePlayer)0x0) {
if (param_1[0x6c] == (CBasePlayer)0x0) {
pCVar1 = *(CBaseEdict **)(param_1 + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
param_1[0x70] = (CBasePlayer)((byte)param_1[0x70] | 1);
}
param_1[0x2429] = (CBasePlayer)0x0;
}
if (param_1[0x242a] != (CBasePlayer)0x0) {
if (param_1[0x6c] == (CBasePlayer)0x0) {
pCVar1 = *(CBaseEdict **)(param_1 + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
param_1[0x70] = (CBasePlayer)((byte)param_1[0x70] | 1);
}
param_1[0x242a] = (CBasePlayer)0x0;
}
CCSPlayer::RemoveDefuser((CCSPlayer *)param_1);
cVar2 = CTerrorPlayer::IsTransitioned((CTerrorPlayer *)param_1);
if ((cVar2 == '\0') || (cVar2 = CDirector::IsTransitionScenarioRestart(), cVar2 != '\0')) {
CBaseCombatCharacter::RemoveAllWeapons((CBaseCombatCharacter *)param_1);
local_44 = (int *)0x0;
local_40 = 0;
if (___atan2f_finite == 0) {
local_34 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_44,0,0,0,0,
"/data/src/game/server/../../game/shared/terror/terrorgamerules.cpp",0x437,
&PlayerSpawn(CBasePlayer*)::tm_fmt,"(%s)%s","Unaccounted","GiveDefaultItems");
local_34 = ___atan2f_finite;
}
iVar4 = _DAT_0105db00;
local_3c = (undefined **)local_44;
local_38 = local_40;
/* try { // try from 005047b0 to 005047b4 has its CatchHandler @ 00504a1c */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar3 = ThreadGetCurrentId(), iVar4 == iVar3)) {
if ((char *)*_DAT_0105d15c != "GiveDefaultItems") {
/* try { // try from 005049dd to 005049ee has its CatchHandler @ 00504a1c */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc298ac,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 005047c2 to 005047c7 has its CatchHandler @ 005049fb */
(**(code **)(*(int *)param_1 + 0x808))(param_1);
iVar4 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar4 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_34 != 0) {
(**(code **)(local_34 + 0x54))(local_34,local_3c,local_38,0,0,0);
}
}
CRecipientFilter::CRecipientFilter((CRecipientFilter *)&local_3c);
local_3c = &PTR__CSingleUserRecipientFilter_00c08ea8;
/* try { // try from 0050483d to 00504841 has its CatchHandler @ 00504a3c */
CRecipientFilter::AddRecipient((CRecipientFilter *)&local_3c,param_1);
/* try { // try from 00504848 to 005048cb has its CatchHandler @ 00504a20 */
CRecipientFilter::MakeReliable((CRecipientFilter *)&local_3c);
if (0 < *(int *)(this + 0x2f4)) {
iVar4 = 0;
do {
while( true ) {
pcVar5 = *(char **)(*(int *)(this + 0x2e8) + iVar4 * 4);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
ConVarRef::ConVarRef((ConVarRef *)&local_44,pcVar5);
cVar2 = (**(code **)(*local_44 + 0x18))(local_44,0x2000);
if (cVar2 == '\0') break;
UserMessageBegin((IRecipientFilter *)&local_3c,"SavedConvar");
MessageWriteString(pcVar5);
MessageEnd();
iVar4 = iVar4 + 1;
if (*(int *)(this + 0x2f4) <= iVar4) goto LAB_005048d7;
}
iVar4 = iVar4 + 1;
} while (iVar4 < *(int *)(this + 0x2f4));
}
LAB_005048d7:
local_3c = &PTR__CSingleUserRecipientFilter_00c08ea8;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)&local_3c);
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.