L4D1SurvivorBehavior::SelectCloserThreat
0x00922c80 · 302 bytes · __thiscall
_ZNK20L4D1SurvivorBehavior18SelectCloserThreatEPK13CTerrorPlayerP20CBaseCombatCharacterS4_
Decompiled
undefined (4 params)
/* L4D1SurvivorBehavior::SelectCloserThreat(CTerrorPlayer const*, CBaseCombatCharacter*,
CBaseCombatCharacter*) const */
CBaseCombatCharacter * __thiscall
L4D1SurvivorBehavior::SelectCloserThreat
(L4D1SurvivorBehavior *this,CTerrorPlayer *param_1,CBaseCombatCharacter *param_2,
CBaseCombatCharacter *param_3)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
CTerrorPlayer CVar7;
if (((byte)param_2[0x14d] & 8) == 0) {
CVar7 = param_1[0x14d];
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
CVar7 = param_1[0x14d];
}
if (((byte)CVar7 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
fVar1 = *(float *)(param_1 + 0x2e4);
fVar2 = *(float *)(param_1 + 0x2e8);
fVar3 = *(float *)(param_2 + 0x2e4);
fVar4 = *(float *)(param_2 + 0x2e8);
fVar5 = *(float *)(param_1 + 0x2e0);
fVar6 = *(float *)(param_2 + 0x2e0);
if (((byte)param_3[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_3);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if ((fVar1 - fVar3) * (fVar1 - fVar3) + (fVar2 - fVar4) * (fVar2 - fVar4) +
(fVar5 - fVar6) * (fVar5 - fVar6) <
(*(float *)(param_1 + 0x2e4) - *(float *)(param_3 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(param_3 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(param_3 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(param_3 + 0x2e0)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(param_3 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(param_3 + 0x2e8))) {
param_3 = param_2;
}
return param_3;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.