CAbusiveBehaviorAwardTemplate::FireGameEvent
0x0084b240 · 1187 bytes · __thiscall
_ZN29CAbusiveBehaviorAwardTemplate13FireGameEventEP10IGameEvent
Decompiled
undefined (2 params)
/* CAbusiveBehaviorAwardTemplate::FireGameEvent(IGameEvent*) */
void __thiscall
CAbusiveBehaviorAwardTemplate::FireGameEvent
(CAbusiveBehaviorAwardTemplate *this,IGameEvent *param_1)
{
float fVar1;
char *pcVar2;
CBaseEntity *this_00;
int iVar3;
CBaseEntity *pCVar4;
uint uVar5;
CBaseEntity *this_01;
int iVar6;
CAbusiveBehaviorAwardTemplate *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_incapacitated") ||
(iVar3 = _V_stricmp(pcVar2,"player_incapacitated"), iVar3 == 0)) ||
(pcVar2 == "player_ledge_grab")) ||
(iVar3 = _V_stricmp(pcVar2,"player_ledge_grab"), iVar3 == 0)) {
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);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != iVar6) {
return;
}
if (*(int *)(pCVar4 + 0x30) != 0) {
iVar3 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58);
goto LAB_0084b4fa;
}
LAB_0084b6e7:
if (*(float *)(this + 0x14) <= 0.0) {
return;
}
fVar1 = *(float *)(this + 0x14);
pCVar7 = this + 0x10;
}
else {
if ((pcVar2 != "player_hurt") && (iVar3 = _V_stricmp(pcVar2,"player_hurt"), iVar3 != 0)) {
if ((pcVar2 != "player_shoved") && (iVar3 = _V_stricmp(pcVar2,"player_shoved"), 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);
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
this_01 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (pCVar4 == (CBaseEntity *)0x0) {
return;
}
if (this_01 == (CBaseEntity *)0x0) {
return;
}
if (this_00 == pCVar4) {
return;
}
if (this_00 != this_01) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
iVar6 = CBaseEntity::GetTeamNumber(this_01);
if (iVar3 != iVar6) {
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;
}
goto LAB_0084b58a;
}
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);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != iVar6) {
return;
}
uVar5 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"type",0);
if ((uVar5 & 0x20) == 0) {
return;
}
if (*(int *)(pCVar4 + 0x30) == 0) goto LAB_0084b6e7;
iVar3 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58);
LAB_0084b4fa:
pCVar7 = this + (iVar3 >> 4) * 8 + 0x10;
fVar1 = *(float *)(pCVar7 + 4);
}
if (fVar1 <= 0.0) {
return;
}
lVar8 = (longdouble)IntervalTimer::Now();
if (3.0 <= (float)lVar8 - *(float *)(pCVar7 + 4)) {
return;
}
(**(code **)(*(int *)this + 0x14))(this,0x5d,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;
LAB_0084b58a:
(**(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.