CLogicDirectorQuery::InputHowAngry
0x00871e10 · 645 bytes · __thiscall
_ZN19CLogicDirectorQuery13InputHowAngryER11inputdata_t
Decompiled
undefined (2 params)
/* CLogicDirectorQuery::InputHowAngry(inputdata_t&) */
void __thiscall CLogicDirectorQuery::InputHowAngry(CLogicDirectorQuery *this,inputdata_t *param_1)
{
char cVar1;
int *piVar2;
CBaseEntity *this_00;
int iVar3;
int iVar4;
undefined4 uVar5;
float fVar6;
double local_44;
int local_38;
int local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
cVar1 = CTerrorGameRules::IsVersusMode();
if ((cVar1 == '\0') && (cVar1 = CTerrorGameRules::IsScavengeMode(), cVar1 == '\0')) {
if (*(int *)(gpGlobals + 0x14) < 1) {
iVar4 = 1;
local_44 = 1.0;
}
else {
iVar4 = 1;
fVar6 = 0.0;
do {
this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar4);
if (((((this_00 != (CBaseEntity *)0x0) && (*(int *)(this_00 + 0x30) != 0)) &&
(*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
((cVar1 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar1 != '\0' &&
(*(int *)(this_00 + 0x1f6c) != 2)))) &&
((cVar1 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar1 != '\0' &&
((iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 == 2 &&
(cVar1 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00), cVar1 == '\0')))))) {
fVar6 = (float)*(int *)(this_00 + 0x100) + fVar6;
}
iVar4 = iVar4 + 1;
} while (iVar4 <= *(int *)(gpGlobals + 0x14));
fVar6 = fVar6 * 0.0025;
if (1.0 <= fVar6) {
fVar6 = 1.0;
}
if (fVar6 <= 0.0) {
fVar6 = 0.0;
}
fVar6 = fVar6 * 49.0 + 1.0;
iVar4 = (int)fVar6;
local_44 = (double)fVar6;
}
iVar3 = RandomInt(1,100);
if (iVar3 <= *(int *)(this + 0x490)) {
fVar6 = ((float)iVar3 + -1.0) * 0.01010101;
if (1.0 <= fVar6) {
fVar6 = 1.0;
}
if (fVar6 <= 0.0) {
fVar6 = 0.0;
}
iVar4 = (int)(fVar6 * 50.0);
}
fVar6 = ((float)*(int *)(this + 0x48c) - (float)*(int *)(this + 0x488)) * 0.020408163 *
((float)iVar4 + -1.0) + (float)*(int *)(this + 0x488);
iVar3 = (int)fVar6;
if (0.5 <= fVar6 - (float)iVar3) {
iVar3 = iVar3 + (uint)(iVar3 < *(int *)(this + 0x48c));
}
Msg("TRUE Anger: %3.2f Processed Anger: %3d Out Anger: %3d\n",local_44,iVar4,iVar3);
uVar5 = *(undefined4 *)param_1;
piVar2 = &local_34;
local_34 = iVar3;
}
else {
uVar5 = *(undefined4 *)param_1;
local_38 = *(int *)(this + 0x488);
piVar2 = &local_38;
}
variant_t::Set((variant_t *)(this + 0x440),5,piVar2);
local_30 = *(undefined4 *)(this + 0x440);
local_2c = *(undefined4 *)(this + 0x444);
local_28 = *(undefined4 *)(this + 0x448);
local_24 = *(undefined4 *)(this + 0x44c);
local_20 = *(undefined4 *)(this + 0x450);
CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x440),&local_30,uVar5,this,0);
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.