CTerrorGameRules::GetAmmoDamage
0x005043f0 · 279 bytes · __thiscall
_ZN16CTerrorGameRules13GetAmmoDamageEP11CBaseEntityS1_i
Decompiled
undefined (4 params)
/* CTerrorGameRules::GetAmmoDamage(CBaseEntity*, CBaseEntity*, int) */
longdouble __thiscall
CTerrorGameRules::GetAmmoDamage
(CTerrorGameRules *this,CBaseEntity *param_1,CBaseEntity *param_2,int param_3)
{
char cVar1;
CAmmoDef *this_00;
int iVar2;
CBaseEntity *pCVar3;
longdouble lVar4;
float fVar5;
this_00 = (CAmmoDef *)GetAmmoDef();
iVar2 = CAmmoDef::Index(this_00,"AMMO_TYPE_TURRET");
if (iVar2 != param_3) {
lVar4 = (longdouble)CGameRules::GetAmmoDamage((CGameRules *)this,param_1,param_2,param_3);
return lVar4;
}
iVar2 = CBaseEntity::GetTeamNumber(param_2);
cVar1 = IsASurvivorTeam(iVar2);
if (cVar1 != '\0') {
fVar5 = *(float *)(ammo_turret_survivor_damage._28_4_ + 0x2c);
goto LAB_0050445e;
}
cVar1 = (**(code **)(*(int *)param_2 + 0x16c))(param_2);
if (cVar1 != '\0') {
cVar1 = (**(code **)(*(int *)param_2 + 0x16c))();
pCVar3 = (CBaseEntity *)0x0;
if (cVar1 != '\0') {
pCVar3 = param_2;
}
iVar2 = CBaseEntity::GetTeamNumber(pCVar3);
if (iVar2 == 3) {
iVar2 = (**(code **)(*(int *)pCVar3 + 0x544))(pCVar3);
if (iVar2 == 8) {
fVar5 = *(float *)(ammo_turret_tank_damage._28_4_ + 0x2c);
goto LAB_0050445e;
}
}
fVar5 = *(float *)(ammo_turret_pz_damage._28_4_ + 0x2c);
goto LAB_0050445e;
}
pCVar3 = (CBaseEntity *)(**(code **)(*(int *)param_2 + 0x14c))(param_2);
if (pCVar3 == (CBaseEntity *)0x0) {
LAB_00504508:
fVar5 = *(float *)(ammo_turret_infected_damage._28_4_ + 0x2c);
}
else {
iVar2 = CBaseEntity::GetTeamNumber(pCVar3);
if (iVar2 == 3) {
iVar2 = (**(code **)(*(int *)pCVar3 + 0x544))(pCVar3);
if (iVar2 != 7) goto LAB_00504508;
}
fVar5 = *(float *)(ammo_turret_witch_damage._28_4_ + 0x2c);
}
LAB_0050445e:
return (longdouble)fVar5;
}
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.