CCheckpointCompleteAwardTemplate::FireGameEvent
0x0084ceb0 · 1500 bytes · __thiscall
_ZN32CCheckpointCompleteAwardTemplate13FireGameEventEP10IGameEvent
Decompiled
undefined (2 params)
/* CCheckpointCompleteAwardTemplate::FireGameEvent(IGameEvent*) */
void __thiscall
CCheckpointCompleteAwardTemplate::FireGameEvent
(CCheckpointCompleteAwardTemplate *this,IGameEvent *param_1)
{
CBaseEntity *pCVar1;
CBaseEntity *pCVar2;
char *pcVar3;
CBaseEntity *this_00;
int iVar4;
CBaseEntity *pCVar5;
CBaseEntity *this_01;
int iVar6;
int *piVar7;
pcVar3 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
if (((pcVar3 != (char *)0x0) &&
(this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
this_00 != (CBaseEntity *)0x0)) && (iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 == 2))
{
if ((pcVar3 == "map_transition") || (iVar4 = _V_stricmp(pcVar3,"map_transition"), iVar4 == 0)) {
CheckAndAwardCheckpointAwards(this);
this[0x10] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x11] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x12] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x13] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x14] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x15] = (CCheckpointCompleteAwardTemplate)0x0;
return;
}
if ((pcVar3 == "player_first_spawn") ||
(iVar4 = _V_stricmp(pcVar3,"player_first_spawn"), iVar4 == 0)) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
if (iVar4 != 0) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
if (this_00 == pCVar5) {
this[0x10] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x11] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x12] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x13] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x14] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x15] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x16] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x17] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x18] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x19] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x1a] = (CCheckpointCompleteAwardTemplate)0x0;
this[0x1b] = (CCheckpointCompleteAwardTemplate)0x0;
if ((*(int *)(this_00 + 0x30d8) == 0) ||
((*(byte *)(*(int *)(this_00 + 0x30d8) + 300) & 0x80) == 0)) {
this[0x1c] = (CCheckpointCompleteAwardTemplate)0x0;
}
else {
this[0x1c] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
}
}
else if ((pcVar3 == "finale_win") || (iVar4 = _V_stricmp(pcVar3,"finale_win"), iVar4 == 0)) {
CheckAndAwardCheckpointAwards(this);
if ((this[0x1c] != (CCheckpointCompleteAwardTemplate)0x0) &&
(this[0x18] == (CCheckpointCompleteAwardTemplate)0x0)) {
if (this[0x17] == (CCheckpointCompleteAwardTemplate)0x0) {
if (this[0x16] == (CCheckpointCompleteAwardTemplate)0x0) {
(**(code **)(*(int *)this + 0x14))(this,2,0);
}
else {
(**(code **)(*(int *)this + 0x14))(this,1,0);
}
}
else {
(**(code **)(*(int *)this + 0x14))(this,0,0);
}
}
iVar4 = GetGlobalTeam(2);
if (iVar4 != 0) {
piVar7 = (int *)GetGlobalTeam(2);
iVar4 = (**(code **)(*piVar7 + 0x354))(piVar7);
if (iVar4 == 1) {
return;
}
}
if ((this[0x1c] != (CCheckpointCompleteAwardTemplate)0x0) &&
(this[0x1b] == (CCheckpointCompleteAwardTemplate)0x0)) {
if (this[0x1a] == (CCheckpointCompleteAwardTemplate)0x0) {
if (this[0x19] == (CCheckpointCompleteAwardTemplate)0x0) {
(**(code **)(*(int *)this + 0x14))(this,5,0);
}
else {
(**(code **)(*(int *)this + 0x14))(this,4,0);
}
}
else {
(**(code **)(*(int *)this + 0x14))(this,3,0);
}
}
}
else if ((pcVar3 == "player_death") || (iVar4 = _V_stricmp(pcVar3,"player_death"), iVar4 == 0))
{
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
if (iVar4 != 0) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
if (this_00 == pCVar5) {
if (pCVar5 != (CBaseEntity *)0x0) {
this[0x12] = (CCheckpointCompleteAwardTemplate)0x1;
this[0x15] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
else if (pCVar5 != (CBaseEntity *)0x0) {
iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar4 == iVar6) {
this[0x15] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
}
}
else if ((pcVar3 == "player_incapacitated") ||
(iVar4 = _V_stricmp(pcVar3,"player_incapacitated"), iVar4 == 0)) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
if (this_00 == pCVar5) {
if (pCVar5 != (CBaseEntity *)0x0) {
this[0x11] = (CCheckpointCompleteAwardTemplate)0x1;
this[0x14] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
else if (pCVar5 != (CBaseEntity *)0x0) {
iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar4 == iVar6) {
this[0x14] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
}
else {
if ((pcVar3 == "player_hurt") || (iVar4 = _V_stricmp(pcVar3,"player_hurt"), iVar4 == 0)) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
pCVar1 = pCVar5;
if (iVar4 == 0) {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attackerentid",0);
this_01 = (CBaseEntity *)UTIL_EntityByIndex(iVar4);
pCVar2 = this_01;
}
else {
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
this_01 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
pCVar2 = this_01;
}
}
else {
if ((pcVar3 != "player_ledge_grab") &&
(iVar4 = _V_stricmp(pcVar3,"player_ledge_grab"), iVar4 != 0)) {
return;
}
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"causer",0);
this_01 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
pCVar1 = this_01;
pCVar2 = pCVar5;
}
if ((pCVar2 != (CBaseEntity *)0x0) && (pCVar1 != (CBaseEntity *)0x0)) {
if (this_00 == pCVar5) {
iVar4 = CBaseEntity::GetTeamNumber(this_01);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar4 != iVar6) {
this[0x10] = (CCheckpointCompleteAwardTemplate)0x1;
this[0x13] = (CCheckpointCompleteAwardTemplate)0x1;
return;
}
}
iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar4 == iVar6) {
iVar4 = CBaseEntity::GetTeamNumber(this_01);
iVar6 = CBaseEntity::GetTeamNumber(this_00);
if (iVar4 != iVar6) {
this[0x13] = (CCheckpointCompleteAwardTemplate)0x1;
}
}
}
}
}
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.