ZombieBotLocomotion::ResolveZombieCollisions
0x00a54290 · 1109 bytes · __cdecl
_ZN19ZombieBotLocomotion23ResolveZombieCollisionsERK6Vector
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ZombieBotLocomotion::ResolveZombieCollisions(Vector const&) */
Vector * ZombieBotLocomotion::ResolveZombieCollisions(Vector *param_1)
{
uint *puVar1;
float fVar2;
undefined4 uVar3;
uint uVar4;
CBaseEntity *this;
char cVar5;
CBaseEntity *this_00;
int *piVar6;
int iVar7;
undefined *puVar8;
int iVar9;
longdouble lVar10;
float fVar11;
int *in_stack_00000008;
undefined4 *in_stack_0000000c;
float local_54;
float local_50;
float local_4c;
float local_48;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
float local_28;
float local_24;
float local_20;
*(undefined4 *)param_1 = *in_stack_0000000c;
uVar3 = in_stack_0000000c[2];
*(undefined4 *)(param_1 + 4) = in_stack_0000000c[1];
*(undefined4 *)(param_1 + 8) = uVar3;
this_00 = (CBaseEntity *)
(**(code **)(*(int *)in_stack_00000008[0x1e] + 0x14c))((int *)in_stack_00000008[0x1e]);
piVar6 = (int *)(**(code **)(*(int *)this_00 + 0x594))(this_00);
lVar10 = (longdouble)(**(code **)(*piVar6 + 0x118))(piVar6);
fVar2 = (float)lVar10;
cVar5 = (**(code **)(*in_stack_00000008 + 0x114))();
if (cVar5 == '\0') {
cVar5 = (**(code **)(*in_stack_00000008 + 200))();
if (cVar5 == '\0') {
cVar5 = (**(code **)(*in_stack_00000008 + 0xf8))();
if (cVar5 != '\0') {
cVar5 = (**(code **)(*(int *)in_stack_00000008[0x1e] + 300))((int *)in_stack_00000008[0x1e])
;
if (cVar5 != '\0') {
cVar5 = (**(code **)(*in_stack_00000008 + 0x174))();
if (cVar5 != '\0') {
local_3c = 0;
local_38 = 0;
if (_towlower == 0) {
local_2c = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_3c,0,0,0,0,
"/data/src/game/server/terror/zombiebot/zombiebotlocomotion.cpp",0x3c8,
&ResolveZombieCollisions(Vector_const&)::tm_fmt,"(%s)%s","NextBot",
"ZombieBotLocomotion::ResolveZombieCollisions");
local_2c = _towlower;
}
iVar9 = _DAT_0105db00;
local_34 = local_3c;
local_30 = local_38;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 00a543dc to 00a543e0 has its CatchHandler @ 00a546e4 */
iVar7 = ThreadGetCurrentId();
if (iVar9 == iVar7) {
if ((char *)*_DAT_0105d15c != "ZombieBotLocomotion::ResolveZombieCollisions") {
/* try { // try from 00a546b4 to 00a546d7 has its CatchHandler @ 00a546e4 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode
((char *)_DAT_0105d15c,0xd2887c,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
local_4c = vec3_origin;
local_54 = DAT_01053d4c;
local_50 = DAT_01053d50;
if (0 < *(int *)(this_00 + 0x1d34)) {
iVar9 = 0;
local_48 = 0.0;
LAB_00a54457:
do {
uVar4 = *(uint *)(*(int *)(this_00 + 0x1d28) + iVar9 * 4);
if ((((uVar4 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar4 & 0xfff) * 0x10,
puVar8 != (undefined *)0xfffffffc)) && (*(uint *)(puVar8 + 8) == uVar4 >> 0xc))
&& (this = *(CBaseEntity **)(puVar8 + 4), this != (CBaseEntity *)0x0)) {
if (((byte)this_00[0x14d] & 8) != 0) {
/* try { // try from 00a5464b to 00a5464f has its CatchHandler @ 00a54704 */
CBaseEntity::CalcAbsolutePosition(this_00);
}
if (((byte)this[0x14d] & 8) != 0) {
/* try { // try from 00a544a7 to 00a5450c has its CatchHandler @ 00a54704 */
CBaseEntity::CalcAbsolutePosition(this);
}
local_20 = 0.0;
local_28 = *(float *)(this + 0x2e0) - *(float *)(this_00 + 0x2e0);
local_24 = *(float *)(this + 0x2e4) - *(float *)(this_00 + 0x2e4);
lVar10 = (longdouble)VectorNormalize((Vector *)&local_28);
if ((float)lVar10 < fVar2) {
(**(code **)(*(int *)this_00 + 0x1b4))(this_00,this);
iVar9 = iVar9 + 1;
fVar11 = (fVar2 - (float)lVar10) * (1.0 / fVar2 + 1.0 / fVar2) + 1.0;
local_48 = fVar11 + local_48;
fVar11 = -fVar11;
local_4c = local_28 * fVar11 + local_4c;
local_54 = local_24 * fVar11 + local_54;
local_50 = fVar11 * local_20 + local_50;
if (*(int *)(this_00 + 0x1d34) <= iVar9) break;
goto LAB_00a54457;
}
}
iVar9 = iVar9 + 1;
} while (iVar9 < *(int *)(this_00 + 0x1d34));
if (0.0 < local_48) {
local_48 = 1.0 / local_48;
*(float *)param_1 = local_4c * 3.0 * local_48 + *(float *)param_1;
*(float *)(param_1 + 4) = local_54 * 3.0 * local_48 + *(float *)(param_1 + 4);
*(float *)(param_1 + 8) = local_50 * 3.0 * local_48 + *(float *)(param_1 + 8);
}
}
iVar9 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar7 = ThreadGetCurrentId();
if (iVar9 == iVar7) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
return param_1;
}
}
}
}
}
}
return param_1;
}
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.