AI_Response::GetPreDelay
0x005a8ee0 · 517 bytes · __thiscall
_ZNK11AI_Response11GetPreDelayEv
Decompiled
undefined (1 param)
/* AI_Response::GetPreDelay() const */
longdouble __thiscall AI_Response::GetPreDelay(AI_Response *this)
{
ushort uVar1;
byte bVar2;
longdouble lVar3;
float local_14;
float local_10;
local_14 = 0.0;
if (((byte)this[0x97] & 1) == 0) {
return (longdouble)0.0;
}
uVar1 = *(ushort *)(this + 0x99);
if ((uVar1 & 0x7fff) == 0x7c00) {
local_14 = 65504.0;
if ((short)uVar1 < 0) {
local_14 = -65504.0;
}
}
else {
bVar2 = (byte)(uVar1 >> 8);
if ((bVar2 & 0x7c) == 0x7c) {
if ((uVar1 & 0x3ff) == 0) goto LAB_005a8f4b;
}
else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
local_14 = 1.0;
if ((short)uVar1 < 0) {
local_14 = -1.0;
}
local_14 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * local_14;
}
else {
LAB_005a8f4b:
local_14 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar2 >> 7) << 0x1f |
(uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000
);
}
}
uVar1 = *(ushort *)(this + 0x9b);
if ((uVar1 & 0x7fff) == 0x7c00) {
local_10 = 65504.0;
if ((short)uVar1 < 0) {
local_10 = -65504.0;
}
}
else {
bVar2 = (byte)(uVar1 >> 8);
if ((bVar2 & 0x7c) == 0x7c) {
local_10 = 0.0;
if ((uVar1 & 0x3ff) != 0) goto LAB_005a903f;
}
else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
local_10 = 1.0;
if ((short)uVar1 < 0) {
local_10 = -1.0;
}
local_10 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * local_10;
goto LAB_005a903f;
}
local_10 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar2 >> 7) << 0x1f |
(uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000);
}
LAB_005a903f:
lVar3 = (longdouble)RandomInterval((interval_t *)&local_14);
return (longdouble)(float)lVar3;
}
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.