L4D1SurvivorMinigunAttack::FireWeapon
0x00923930 · 4771 bytes · __thiscall
_ZN25L4D1SurvivorMinigunAttack10FireWeaponEP11SurvivorBot
Decompiled
undefined (2 params)
/* WARNING: Removing unreachable block (ram,0x00924228) */
/* WARNING: Removing unreachable block (ram,0x00923fad) */
/* WARNING: Removing unreachable block (ram,0x00923f20) */
/* WARNING: Removing unreachable block (ram,0x00923e9c) */
/* WARNING: Removing unreachable block (ram,0x00924c47) */
/* WARNING: Removing unreachable block (ram,0x00924c31) */
/* WARNING: Removing unreachable block (ram,0x00924be7) */
/* WARNING: Removing unreachable block (ram,0x00924c39) */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* L4D1SurvivorMinigunAttack::FireWeapon(SurvivorBot*) */
char __thiscall
L4D1SurvivorMinigunAttack::FireWeapon(L4D1SurvivorMinigunAttack *this,SurvivorBot *param_1)
{
float fVar1;
code *pcVar2;
undefined **ppuVar3;
char cVar4;
char cVar5;
char cVar6;
CBaseEntity *pCVar7;
int iVar8;
int iVar9;
float *pfVar10;
int *piVar11;
undefined *puVar12;
int *piVar13;
uint uVar14;
int iVar15;
uint *puVar16;
double *pdVar17;
byte bVar18;
float fVar19;
bool bVar20;
longdouble lVar21;
float fVar22;
float fVar23;
float fVar24;
double dVar25;
uint auStack_190 [2];
CBaseEntity local_144;
int local_134;
CBaseEntity local_130;
float local_118;
float local_114;
float local_110;
float local_10c;
float local_108;
float local_104;
float local_100;
float local_fc;
float local_f8;
int *local_f4;
float local_f0;
float local_ec;
undefined **local_e8;
float local_e4;
float local_e0;
CTraceFilterSimple local_dc [16];
int *local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
Vector local_64 [64];
CBaseEntity *local_24;
if (_towlower == 0) {
iVar15 = 0;
}
else {
(**(code **)(_towlower + 0x50))();
iVar15 = _towlower;
}
iVar8 = _DAT_0105db00;
/* try { // try from 00923b26 to 00923b86 has its CatchHandler @ 00924c07 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar9 = ThreadGetCurrentId(), iVar8 == iVar9)) {
if ((char *)*_DAT_0105d15c != "L4D1SurvivorMinigunAttack::FireWeapon") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd03c1c,(char *)0x0,0xd03c1c);
}
puVar16 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar16 = *puVar16 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
puVar16 = (uint *)&stack0xfffffe84;
if (*(int *)(SurvivorBotDontShoot._28_4_ + 0x30) == 0) {
/* try { // try from 00923a18 to 00923ab3 has its CatchHandler @ 00924c1f */
pCVar7 = (CBaseEntity *)SelectTarget(this,param_1);
if ((pCVar7 == (CBaseEntity *)0x0) ||
(cVar4 = (**(code **)(*(int *)pCVar7 + 300))(), cVar4 == '\0')) {
/* try { // try from 00923bf1 to 0092462a has its CatchHandler @ 00924c1f */
cVar4 = INextBot::IsDebugging((INextBot *)(param_1 + 0x4028),1);
puVar16 = (uint *)&stack0xfffffe84;
if (cVar4 != '\0') {
(**(code **)(*(int *)param_1 + 0x9b8))();
DevMsg("%3.2f: %s: NOT FIRING because target is dead/gone\n");
puVar16 = (uint *)&stack0xfffffe84;
}
}
else {
iVar8 = CTerrorPlayer::ClassifyZombie(pCVar7);
if (iVar8 == 7) {
piVar11 = (int *)__dynamic_cast();
piVar11 = (int *)(**(code **)(*piVar11 + 0x594))();
cVar4 = (**(code **)(*piVar11 + 0x114))();
if (cVar4 != '\0') goto LAB_00923c7e;
cVar4 = INextBot::IsDebugging((INextBot *)(param_1 + 0x4028),1);
puVar16 = (uint *)&stack0xfffffe84;
if (cVar4 != '\0') {
(**(code **)(*(int *)param_1 + 0x9b8))();
DevMsg("%3.2f: %s: NOT FIRING because target Witch is calm\n");
puVar16 = (uint *)&stack0xfffffe84;
}
}
else if ((*(int *)(TheDirector + 0x1bc) < 1) ||
(cVar4 = SurvivorBot::IsAnyWitchCloserThan
(param_1,*(float *)(z_witch_wander_hear_radius._28_4_ + 0x2c) +
24.0), cVar4 == '\0')) {
LAB_00923c7e:
(**(code **)(*(int *)param_1 + 0x234))();
puVar16 = (uint *)&stack0xfffffe80;
pfVar10 = (float *)(**(code **)(*(int *)pCVar7 + 0x288))();
local_10c = *pfVar10 - local_118;
local_108 = pfVar10[1] - local_114;
local_104 = pfVar10[2] - local_110;
lVar21 = (longdouble)VectorNormalize((Vector *)&local_10c);
fVar24 = (float)lVar21;
fVar19 = 0.3;
if ((500.0 <= fVar24) && (fVar19 = 1.0, fVar24 <= 3000.0)) {
fVar19 = (fVar24 + -500.0) * 0.00027999998 + 0.3;
}
if (fVar24 < 150.0) {
piVar11 = (int *)(**(code **)(*(int *)param_1 + 0x9ac))();
cVar4 = (**(code **)(*piVar11 + 0xe4))();
if (cVar4 == '\0') goto LAB_00923d27;
bVar18 = 1;
LAB_00923e74:
if ((AllocTempVector()::s_vecTemp == '\0') && (iVar8 = __cxa_guard_acquire(), iVar8 != 0))
{
__cxa_guard_release();
}
if ((AllocTempVector()::s_nIndex == '\0') && (iVar8 = __cxa_guard_acquire(), iVar8 != 0))
{
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release();
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
fVar19 = *(float *)(pCVar7 + 0x1a8);
iVar8 = AllocTempVector()::s_nIndex * 0xc;
bVar20 = AllocTempVector()::s_vecTemp == '\0';
fVar1 = *(float *)(pCVar7 + 0x19c);
*(float *)(AllocTempVector()::s_vecTemp + iVar8) = fVar19 - fVar1;
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 4) =
*(float *)(pCVar7 + 0x1ac) - *(float *)(pCVar7 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 8) =
*(float *)(pCVar7 + 0x1b0) - *(float *)(pCVar7 + 0x1a4);
if ((bVar20) && (iVar8 = __cxa_guard_acquire(), iVar8 != 0)) {
__cxa_guard_release();
}
if ((AllocTempVector()::s_nIndex == '\0') && (iVar8 = __cxa_guard_acquire(), iVar8 != 0))
{
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release();
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar8 = AllocTempVector()::s_nIndex * 0xc;
*(float *)(AllocTempVector()::s_vecTemp + iVar8) =
*(float *)(pCVar7 + 0x1a8) - *(float *)(pCVar7 + 0x19c);
fVar22 = *(float *)(pCVar7 + 0x1ac);
fVar23 = *(float *)(pCVar7 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 4) = fVar22 - fVar23;
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 8) =
*(float *)(pCVar7 + 0x1b0) - *(float *)(pCVar7 + 0x1a4);
if (fVar19 - fVar1 <= fVar22 - fVar23) {
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar8 = __cxa_guard_acquire(), iVar8 != 0)) {
__cxa_guard_release();
}
if ((AllocTempVector()::s_nIndex == '\0') && (iVar8 = __cxa_guard_acquire(), iVar8 != 0)
) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release();
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar8 = AllocTempVector()::s_nIndex * 0xc;
*(float *)(AllocTempVector()::s_vecTemp + iVar8) =
*(float *)(pCVar7 + 0x1a8) - *(float *)(pCVar7 + 0x19c);
fVar19 = *(float *)(pCVar7 + 0x1ac) - *(float *)(pCVar7 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 4) = fVar19;
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 8) =
*(float *)(pCVar7 + 0x1b0) - *(float *)(pCVar7 + 0x1a4);
}
else {
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar8 = __cxa_guard_acquire(), iVar8 != 0)) {
__cxa_guard_release();
}
if ((AllocTempVector()::s_nIndex == '\0') && (iVar8 = __cxa_guard_acquire(), iVar8 != 0)
) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release();
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar8 = AllocTempVector()::s_nIndex * 0xc;
fVar19 = *(float *)(pCVar7 + 0x1a8) - *(float *)(pCVar7 + 0x19c);
*(float *)(AllocTempVector()::s_vecTemp + iVar8) = fVar19;
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 4) =
*(float *)(pCVar7 + 0x1ac) - *(float *)(pCVar7 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar8 + 8) =
*(float *)(pCVar7 + 0x1b0) - *(float *)(pCVar7 + 0x1a4);
}
dVar25 = atan((double)(fVar19 / fVar24));
dVar25 = cos(dVar25);
piVar11 = (int *)(**(code **)(*(int *)param_1 + 0x9a4))();
pfVar10 = (float *)(**(code **)(*piVar11 + 0xbc))();
if (!(bool)(pfVar10[1] * local_108 + *pfVar10 * local_10c + pfVar10[2] * local_104 <
(float)dVar25 & (bVar18 ^ 1))) {
cVar5 = (**(code **)(*(int *)param_1 + 0x7e8))();
cVar4 = '\0';
if (cVar5 == '\0') {
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)param_1,0,(_func_bool_IHandleEntity_ptr_int *)0x0
);
CBasePlayer::EyeVectors
((CBasePlayer *)param_1,(Vector *)&local_100,(Vector *)0x0,(Vector *)0x0);
fVar22 = local_100 * fVar24;
fVar23 = local_fc * fVar24;
fVar24 = fVar24 * local_f8;
(**(code **)(*(int *)param_1 + 0x234))();
fVar1 = local_e0;
fVar19 = local_e4;
ppuVar3 = local_e8;
(**(code **)(*(int *)param_1 + 0x234))();
pdVar17 = (double *)&stack0xfffffe78;
local_88 = 0;
local_cc = local_f4;
local_c8 = local_f0;
local_8c = 0;
local_9c = 0x40000000;
local_98 = 0x40000000;
local_bc = ((float)ppuVar3 - (float)local_f4) + fVar22;
local_94 = 0x40000000;
local_b8 = (fVar19 - local_f0) + fVar23;
local_c4 = local_ec;
local_b4 = (fVar1 - local_ec) + fVar24;
local_ac = 0;
local_a8 = 0;
local_a4 = 0;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
(**(code **)(*enginetrace + 0x14))();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
}
cVar5 = CGameTrace::DidHitNonWorldEntity((CGameTrace *)local_70);
if (((cVar5 == '\0') ||
(cVar5 = (**(code **)(*(int *)local_24 + 0x16c))(), cVar5 == '\0')) ||
(cVar5 = (**(code **)(*(int *)local_24 + 300))(), cVar5 == '\0')) {
LAB_009245e0:
local_144 = (CBaseEntity)0x1;
}
else {
iVar8 = CBaseEntity::GetTeamNumber(local_24);
cVar5 = IsASurvivorTeam(iVar8);
if (((((cVar5 == '\0') ||
(((cVar5 = (**(code **)(*(int *)local_24 + 0x7e8))(), cVar5 != '\0' &&
(local_24[0x39f1] == (CBaseEntity)0x0)) &&
(local_24[0x33dc] == (CBaseEntity)0x0)))) ||
(((uVar14 = *(uint *)(local_24 + 0x3ee0), uVar14 != 0xffffffff &&
(puVar12 = g_pEntityList + (uVar14 & 0xfff) * 0x10,
puVar12 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar12 + 8) == uVar14 >> 0xc && (*(int *)(puVar12 + 4) != 0))))))
|| (((((uVar14 = *(uint *)(local_24 + 0x3e48), uVar14 != 0xffffffff &&
(puVar12 = g_pEntityList + (uVar14 & 0xfff) * 0x10,
puVar12 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar12 + 8) == uVar14 >> 0xc)) && (*(int *)(puVar12 + 4) != 0)
) || (((uVar14 = *(uint *)(local_24 + 0x3e68), uVar14 != 0xffffffff &&
(puVar12 = g_pEntityList + (uVar14 & 0xfff) * 0x10,
puVar12 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar12 + 8) == uVar14 >> 0xc &&
(*(int *)(puVar12 + 4) != 0)))))))) ||
(((uVar14 = *(uint *)(local_24 + 0x33c4), uVar14 != 0xffffffff &&
(puVar12 = g_pEntityList + (uVar14 & 0xfff) * 0x10,
puVar12 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar12 + 8) == uVar14 >> 0xc && (*(int *)(puVar12 + 4) != 0))))))
goto LAB_009245e0;
local_144 = local_24[0x39f1];
}
piVar11 = (int *)CDirector::GetForbiddenTargets(TheDirector);
if (piVar11[3] < 1) {
LAB_00924763:
local_130 = local_144;
puVar16 = (uint *)pdVar17;
}
else if (local_144 == (CBaseEntity)0x0) {
local_130 = (CBaseEntity)0x0;
puVar16 = (uint *)&stack0xfffffe78;
}
else {
local_134 = 0;
pdVar17 = (double *)&stack0xfffffe78;
do {
while ((((uVar14 = *(uint *)(*piVar11 + local_134 * 4), uVar14 == 0xffffffff ||
(puVar12 = g_pEntityList + (uVar14 & 0xfff) * 0x10,
puVar12 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar12 + 8) != uVar14 >> 0xc)) ||
(piVar13 = *(int **)(puVar12 + 4), piVar13 == (int *)0x0))) {
LAB_0092474b:
local_134 = local_134 + 1;
if (piVar11[3] <= local_134) goto LAB_00924763;
}
iVar8 = *(int *)(param_1 + 0x4028);
fVar24 = *(float *)(car_alarm_distance._28_4_ + 0x2c);
*(int **)((int)pdVar17 + 4) = piVar13;
*(float *)(pdVar17 + 1) = fVar24 * 1.1;
*(SurvivorBot **)pdVar17 = param_1 + 0x4028;
/* try { // try from 009248ab to 00924ab8 has its CatchHandler @ 00924c1f */
pcVar2 = *(code **)(iVar8 + 0x114);
*(undefined4 *)((int)pdVar17 + -4) = 0x9248b1;
cVar5 = (*pcVar2)();
if (cVar5 == '\0') goto LAB_0092474b;
iVar8 = *(int *)param_1;
*(SurvivorBot **)((int)pdVar17 + 4) = param_1;
*(int ***)pdVar17 = &local_cc;
pcVar2 = *(code **)(iVar8 + 0x234);
*(undefined4 *)((int)pdVar17 + -4) = 0x9248ce;
(*pcVar2)();
iVar8 = *piVar13;
*(int **)((int)pdVar17 + -4) = piVar13;
pcVar2 = *(code **)(iVar8 + 0x288);
*(undefined4 *)(pdVar17 + -1) = 0x9248e2;
pfVar10 = (float *)(*pcVar2)();
local_e8 = (undefined **)(*pfVar10 - (float)local_cc);
local_e4 = pfVar10[1] - local_c8;
fVar24 = pfVar10[2];
*(undefined ****)((int)pdVar17 + -4) = &local_e8;
local_e0 = fVar24 - local_c4;
*(undefined4 *)(pdVar17 + -1) = 0x92492e;
VectorNormalize(*(Vector **)((int)pdVar17 + -4));
if (0.8 < local_e4 * local_fc + (float)local_e8 * local_100 + local_e0 * local_f8)
{
*(uint *)(pdVar17 + 1) = 0x461c4000;
*(uint *)((int)pdVar17 + 4) = 5;
*(int **)pdVar17 = piVar13;
*(undefined4 *)((int)pdVar17 + -4) = TheNavMesh;
*(undefined4 *)(pdVar17 + -1) = 0x9249d7;
iVar9 = CNavMesh::GetNearestNavArea
(*(CNavMesh **)((int)pdVar17 + -4),*(CBaseEntity **)pdVar17,
*(uint *)((int)pdVar17 + 4),*(float *)(pdVar17 + 1));
iVar8 = *(int *)param_1;
*(SurvivorBot **)((int)pdVar17 + -4) = param_1;
pcVar2 = *(code **)(iVar8 + 0x52c);
*(undefined4 *)(pdVar17 + -1) = 0x9249e8;
iVar8 = (*pcVar2)();
if ((iVar8 == 0) || (iVar9 == 0)) goto LAB_00924971;
*(uint *)((int)pdVar17 + 4) = 0;
*(int *)((int)pdVar17 + -4) = iVar8;
*(int *)pdVar17 = iVar9;
*(undefined4 *)(pdVar17 + -1) = 0x924a14;
cVar5 = TerrorNavArea::IsPotentiallyVisible
(*(TerrorNavArea **)((int)pdVar17 + -4),
*(TerrorNavArea **)pdVar17,*(bool *)((int)pdVar17 + 4));
if (cVar5 == '\0') goto LAB_00924971;
*(undefined4 *)pdVar17 = 1;
*(SurvivorBot **)((int)pdVar17 + -4) = param_1 + 0x4028;
*(undefined4 *)(pdVar17 + -1) = 0x924a32;
cVar5 = INextBot::IsDebugging
(*(INextBot **)((int)pdVar17 + -4),*(uint *)pdVar17);
if (cVar5 != '\0') {
iVar8 = *(int *)param_1;
*(SurvivorBot **)((int)pdVar17 + -4) = param_1;
pcVar2 = *(code **)(iVar8 + 0x9b8);
*(undefined4 *)(pdVar17 + -1) = 0x924a4d;
uVar14 = (*pcVar2)();
*(uint *)(pdVar17 + 1) = uVar14;
fVar24 = *(float *)(gpGlobals + 0xc);
*(char **)((int)pdVar17 + -4) =
"%3.2f: %s: NOT FIRING because we might hit the car alarm\n";
*pdVar17 = (double)fVar24;
*(undefined4 *)(pdVar17 + -1) = 0x924a70;
DevMsg(*(char **)((int)pdVar17 + -4));
}
local_130 = (CBaseEntity)0x0;
}
else {
LAB_00924971:
local_130 = local_144;
}
local_134 = local_134 + 1;
puVar16 = (uint *)((int)pdVar17 + -4);
} while ((local_134 < piVar11[3]) &&
(puVar16 = (uint *)((int)pdVar17 + -4),
pdVar17 = (double *)((int)pdVar17 + -4), local_130 != (CBaseEntity)0x0));
}
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
pcVar2 = *(code **)(iVar8 + 0x550);
puVar16[-1] = 0x92462b;
cVar5 = (*pcVar2)();
if (cVar5 == '\0') {
local_e8 = &PTR_IsAllowed_00d00f08;
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
/* try { // try from 00924787 to 0092485f has its CatchHandler @ 00924c55 */
pcVar2 = *(code **)(iVar8 + 0x9ac);
puVar16[-1] = 0x92478d;
piVar11 = (int *)(*pcVar2)();
iVar8 = *piVar11;
*puVar16 = (uint)piVar11;
puVar16[1] = (uint)&local_e8;
pcVar2 = *(code **)(iVar8 + 0xc4);
puVar16[-1] = 0x9247a2;
piVar11 = (int *)(*pcVar2)();
if (piVar11 != (int *)0x0) {
iVar8 = *piVar11;
*puVar16 = (uint)piVar11;
pcVar2 = *(code **)(iVar8 + 0x16c);
puVar16[-1] = 0x9247bd;
cVar5 = (*pcVar2)();
if (cVar5 != '\0') {
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
pcVar2 = *(code **)(iVar8 + 0x9ac);
puVar16[-1] = 0x9247d0;
piVar13 = (int *)(*pcVar2)();
iVar8 = *piVar13;
puVar16[2] = 0x3f4ccccd;
*puVar16 = (uint)piVar13;
puVar16[1] = (uint)piVar11;
pcVar2 = *(code **)(iVar8 + 0x100);
puVar16[-1] = 0x9247ed;
cVar5 = (*pcVar2)();
if (cVar5 != '\0') {
local_cc = piVar11;
*puVar16 = (uint)&local_cc;
puVar16[-1] = 0x92480f;
bVar20 = ForEachSurvivor<AnyoneTooCloseToBoomerCheck>
((AnyoneTooCloseToBoomerCheck *)*puVar16);
if (!bVar20) {
puVar16[1] = 1;
*puVar16 = (uint)(param_1 + 0x4028);
puVar16[-1] = 0x92482d;
cVar5 = INextBot::IsDebugging((INextBot *)*puVar16,puVar16[1]);
if (cVar5 != '\0') {
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
pcVar2 = *(code **)(iVar8 + 0x9b8);
puVar16[-1] = 0x924840;
iVar8 = (*pcVar2)();
puVar16[3] = iVar8;
fVar24 = *(float *)(gpGlobals + 0xc);
*puVar16 = (uint)
"%3.2f: %s: NOT FIRING because we would pop the Boomer on a survivor\n"
;
*(double *)(puVar16 + 1) = (double)fVar24;
puVar16[-1] = 0x924860;
DevMsg((char *)*puVar16);
}
goto LAB_00923aba;
}
}
}
}
}
if (local_130 == (CBaseEntity)0x0) goto LAB_00923aba;
}
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
pcVar2 = *(code **)(iVar8 + 0x9ac);
puVar16[-1] = 0x92414e;
piVar11 = (int *)(*pcVar2)();
iVar8 = *piVar11;
puVar16[2] = 0;
puVar16[1] = (uint)pCVar7;
*puVar16 = (uint)piVar11;
pcVar2 = *(code **)(iVar8 + 0xf8);
puVar16[-1] = 0x924165;
cVar5 = (*pcVar2)();
if (cVar5 != '\0') {
pcVar2 = *(code **)(*(int *)param_1 + 0x938);
puVar16[1] = 0x3e19999a;
*puVar16 = 0x3dcccccd;
puVar16[-1] = 0x92418b;
lVar21 = (longdouble)RandomFloat();
*puVar16 = (uint)param_1;
puVar16[1] = (uint)(float)lVar21;
puVar16[-1] = 0x9241a4;
(*pcVar2)();
puVar16[1] = 1;
*puVar16 = (uint)(param_1 + 0x4028);
puVar16[-1] = 0x9241ba;
cVar6 = INextBot::IsDebugging((INextBot *)*puVar16,puVar16[1]);
cVar4 = cVar5;
if (cVar6 != '\0') {
iVar8 = *(int *)param_1;
*puVar16 = (uint)param_1;
pcVar2 = *(code **)(iVar8 + 0x9b8);
puVar16[-1] = 0x9241d0;
iVar8 = (*pcVar2)();
puVar16[3] = iVar8;
fVar24 = *(float *)(gpGlobals + 0xc);
*puVar16 = (uint)"%3.2f: %s: CONTINUOUS FIRE!\n";
*(double *)(puVar16 + 1) = (double)fVar24;
puVar16[-1] = 0x9241f3;
DevMsg((char *)*puVar16);
}
}
goto LAB_00923aba;
}
cVar4 = INextBot::IsDebugging((INextBot *)(param_1 + 0x4028),1);
puVar16 = (uint *)&stack0xfffffe80;
if (cVar4 != '\0') {
(**(code **)(*(int *)param_1 + 0x9b8))();
DevMsg("%3.2f: %s: NOT FIRING because our aim is off\n");
puVar16 = (uint *)&stack0xfffffe80;
}
}
else {
LAB_00923d27:
piVar11 = (int *)(**(code **)(*(int *)param_1 + 0x9a4))();
cVar4 = (**(code **)(*piVar11 + 0xcc))();
if (cVar4 != '\0') {
piVar11 = (int *)(**(code **)(*(int *)param_1 + 0x9a4))();
lVar21 = (longdouble)(**(code **)(*piVar11 + 0xd0))();
bVar18 = 0;
if (fVar19 <= (float)lVar21) goto LAB_00923e74;
}
cVar4 = INextBot::IsDebugging((INextBot *)(param_1 + 0x4028),1);
puVar16 = (uint *)&stack0xfffffe80;
if (cVar4 != '\0') {
(**(code **)(*(int *)param_1 + 0x9b8))();
DevMsg("%3.2f: %s: NOT FIRING because our head hasn\'t been still long enough\n");
puVar16 = (uint *)&stack0xfffffe80;
}
}
}
else {
(**(code **)(*(int *)param_1 + 0x9b8))();
DevMsg("%3.2f: %s: NOT FIRING because I am very close to a calm witch.\n");
puVar16 = (uint *)&stack0xfffffe84;
}
}
}
cVar4 = '\0';
LAB_00923aba:
iVar8 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
puVar16[-1] = 0x923ba3;
iVar9 = ThreadGetCurrentId();
if (iVar8 == iVar9) {
*puVar16 = (uint)_DAT_0105d15c;
puVar16[-1] = 0x923bb8;
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (iVar15 != 0) {
puVar16[5] = 0;
puVar16[4] = 0;
puVar16[3] = 0;
*puVar16 = iVar15;
puVar16[1] = 0;
puVar16[2] = 0;
pcVar2 = *(code **)(iVar15 + 0x54);
puVar16[-1] = 0x923b11;
(*pcVar2)();
}
return cVar4;
}
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.