CGameRules::GetPlayerSpawnSpot
0x0045f4c0 · 442 bytes · __thiscall
_ZN10CGameRules18GetPlayerSpawnSpotEP11CBasePlayer
Decompiled
undefined (2 params)
/* CGameRules::GetPlayerSpawnSpot(CBasePlayer*) */
CBaseEntity * __thiscall CGameRules::GetPlayerSpawnSpot(CGameRules *this,CBasePlayer *param_1)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
CBaseEntity *this_00;
undefined4 local_28;
undefined4 local_24;
float local_20;
this_00 = (CBaseEntity *)(**(code **)(*(int *)param_1 + 0x698))(param_1);
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
local_28 = *(undefined4 *)(this_00 + 0x2e0);
local_24 = *(undefined4 *)(this_00 + 0x2e4);
local_20 = *(float *)(this_00 + 0x2e8) + 1.0;
CBaseEntity::SetLocalOrigin((CBaseEntity *)param_1,(Vector *)&local_28);
CBaseEntity::SetAbsVelocity((CBaseEntity *)param_1,(Vector *)&vec3_origin);
CBaseEntity::SetLocalAngles((CBaseEntity *)param_1,(QAngle *)(this_00 + 0x3a8));
fVar4 = DAT_01053d44;
fVar3 = DAT_01053d40;
fVar2 = vec3_angle;
if (((vec3_angle == *(float *)(param_1 + 0x1ab0)) &&
(DAT_01053d40 == *(float *)(param_1 + 0x1ab4))) &&
(DAT_01053d44 == *(float *)(param_1 + 0x1ab8))) {
fVar1 = *(float *)(param_1 + 0x1abc);
}
else {
(**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1ab0);
fVar1 = *(float *)(param_1 + 0x1abc);
*(float *)(param_1 + 0x1ab0) = fVar2;
*(float *)(param_1 + 0x1ab4) = fVar3;
*(float *)(param_1 + 0x1ab8) = fVar4;
}
if (((fVar2 != fVar1) || (fVar3 != *(float *)(param_1 + 0x1ac0))) ||
(fVar4 != *(float *)(param_1 + 0x1ac4))) {
(**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1abc);
*(float *)(param_1 + 0x1abc) = fVar2;
*(float *)(param_1 + 0x1ac0) = fVar3;
*(float *)(param_1 + 0x1ac4) = fVar4;
}
CBasePlayer::SnapEyeAngles(param_1,(QAngle *)(this_00 + 0x3a8));
return this_00;
}
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.