CHinderingEscapeAwardTemplate::FireGameEvent
0x00854a00 · 1004 bytes · __thiscall
_ZN29CHinderingEscapeAwardTemplate13FireGameEventEP10IGameEvent
Decompiled
undefined (2 params)
/* CHinderingEscapeAwardTemplate::FireGameEvent(IGameEvent*) */
void __thiscall
CHinderingEscapeAwardTemplate::FireGameEvent
(CHinderingEscapeAwardTemplate *this,IGameEvent *param_1)
{
float fVar1;
char *pcVar2;
CBaseEntity *this_00;
int iVar3;
CBaseEntity *pCVar4;
int iVar5;
CBaseEntity *pCVar6;
CHinderingEscapeAwardTemplate *pCVar7;
longdouble lVar8;
float local_20;
pcVar2 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
if (pcVar2 == (char *)0x0) {
return;
}
this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this);
if (this_00 == (CBaseEntity *)0x0) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != 2) {
return;
}
if ((pcVar2 == "player_blocked") || (iVar3 = _V_stricmp(pcVar2,"player_blocked"), iVar3 == 0)) {
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"blocker",0);
pCVar6 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (pCVar4 == (CBaseEntity *)0x0) {
return;
}
if (pCVar6 == (CBaseEntity *)0x0) {
return;
}
if (this_00 != pCVar6) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
iVar5 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != iVar5) {
return;
}
if (*(int *)(pCVar4 + 0x30) == 0) {
iVar3 = 0;
}
else {
iVar3 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
pCVar7 = this + iVar3 * 8 + 0x10;
lVar8 = (longdouble)IntervalTimer::Now();
local_20 = (float)lVar8;
if (local_20 == *(float *)(pCVar7 + 4)) {
return;
}
}
else {
if ((((pcVar2 != "player_hurt") && (iVar3 = _V_stricmp(pcVar2,"player_hurt"), iVar3 != 0)) &&
(pcVar2 != "player_incapacitated")) &&
(iVar3 = _V_stricmp(pcVar2,"player_incapacitated"), iVar3 != 0)) {
if ((pcVar2 == "map_transition") || (iVar3 = _V_stricmp(pcVar2,"map_transition"), iVar3 == 0))
{
iVar3 = 0;
pCVar7 = this + 0x10;
do {
if (*(float *)(this + (int)(pCVar7 + (4 - (int)this))) != -1.0) {
(**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
*(undefined4 *)(this + (int)(pCVar7 + (4 - (int)this))) = 0xbf800000;
}
iVar3 = iVar3 + 1;
pCVar7 = pCVar7 + 8;
} while (iVar3 != 0x20);
return;
}
if ((pcVar2 != "player_first_spawn") &&
(iVar3 = _V_stricmp(pcVar2,"player_first_spawn"), iVar3 != 0)) {
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
if (iVar3 == 0) {
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (this_00 != pCVar4) {
return;
}
iVar3 = 0;
pCVar7 = this + 0x10;
do {
if (*(float *)(this + (int)(pCVar7 + (4 - (int)this))) != -1.0) {
(**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
*(undefined4 *)(this + (int)(pCVar7 + (4 - (int)this))) = 0xbf800000;
}
iVar3 = iVar3 + 1;
pCVar7 = pCVar7 + 8;
} while (iVar3 != 0x20);
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (this_00 == pCVar4) {
return;
}
if (pCVar4 == (CBaseEntity *)0x0) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
iVar5 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != iVar5) {
return;
}
if (*(int *)(pCVar4 + 0x30) == 0) {
if (*(float *)(this + 0x14) <= 0.0) {
return;
}
fVar1 = *(float *)(this + 0x14);
pCVar7 = this + 0x10;
}
else {
pCVar7 = this + (*(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) * 8 + 0x10;
fVar1 = *(float *)(pCVar7 + 4);
}
if (fVar1 <= 0.0) {
return;
}
lVar8 = (longdouble)IntervalTimer::Now();
if (1.5 <= (float)lVar8 - *(float *)(pCVar7 + 4)) {
return;
}
(**(code **)(*(int *)this + 0x14))(this,0x5c,0);
if (*(int *)(pCVar4 + 0x30) == 0) {
iVar3 = 0;
}
else {
iVar3 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
pCVar7 = this + iVar3 * 8 + 0x10;
if (*(float *)(pCVar7 + 4) == -1.0) {
return;
}
local_20 = -1.0;
}
(**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
*(float *)(pCVar7 + 4) = local_20;
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.