CSpitAbility::UpdateAbility
0x004dbcc0 · 2939 bytes · __thiscall
_ZN12CSpitAbility13UpdateAbilityEv
Decompiled
undefined (1 param)
/* CSpitAbility::UpdateAbility() */
void __thiscall CSpitAbility::UpdateAbility(CSpitAbility *this)
{
float fVar1;
uint uVar2;
CBaseEntity *this_00;
code *pcVar3;
int iVar4;
CBaseEdict *pCVar5;
char cVar6;
undefined4 uVar7;
int iVar8;
undefined *puVar9;
uint uVar10;
int *piVar11;
int iVar12;
int *piVar13;
longdouble lVar14;
longdouble lVar15;
int local_13c;
float local_138;
float local_134;
float local_130;
float local_128;
float local_124;
float local_120;
float local_11c;
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;
float local_f4;
float local_f0;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_e0;
int *local_dc;
undefined4 local_d8;
undefined4 local_d4;
undefined1 local_d0;
undefined1 local_cf;
float 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;
CAI_Concept local_70 [12];
float local_64;
float local_60;
float local_5c;
float local_44;
int local_24;
if (this[0x45d] == (CSpitAbility)0x0) {
return;
}
uVar2 = *(uint *)(this + 0x44c);
if (uVar2 == 0xffffffff) {
return;
}
puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
if (puVar9 == (undefined *)0xfffffffc) {
return;
}
if (*(uint *)(puVar9 + 8) != uVar2 >> 0xc) {
return;
}
this_00 = *(CBaseEntity **)(puVar9 + 4);
if (this_00 == (CBaseEntity *)0x0) {
return;
}
if (*(float *)(this + 0x468) <= 0.0) {
LAB_004dc2cf:
if ((this_00[0x488] != (CBaseEntity)0x0) &&
(CBaseAbility::StartActivationTimer
((CBaseAbility *)this,*(float *)(z_spit_interval._28_4_ + 0x2c),0.0),
this[0x45d] != (CSpitAbility)0x0)) {
if (this[0x6c] == (CSpitAbility)0x0) {
pCVar5 = *(CBaseEdict **)(this + 0x30);
if (pCVar5 != (CBaseEdict *)0x0) {
*(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar5);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CSpitAbility)((byte)this[0x70] | 1);
}
this[0x45d] = (CSpitAbility)0x0;
}
return;
}
if (*(float *)(this_00 + 0x2848) != 3000.0) {
if (this_00[0x6c] == (CBaseEntity)0x0) {
pCVar5 = *(CBaseEdict **)(this_00 + 0x30);
if (pCVar5 != (CBaseEdict *)0x0) {
*(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar5);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
}
*(undefined4 *)(this_00 + 0x2848) = 0x453b8000;
if (*(float *)(this + 0x468) <= 0.0) goto LAB_004dc2cf;
}
lVar14 = (longdouble)CountdownTimer::Now();
if ((float)lVar14 < *(float *)(this + 0x468)) {
if (0.0 < *(float *)(this + 0x468)) {
return;
}
goto LAB_004dc2cf;
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
local_e8 = *(undefined4 *)(this_00 + 0x2e0);
local_dc = (int *)0x0;
local_d8 = 0x4cbebc20;
local_e4 = *(undefined4 *)(this_00 + 0x2e4);
local_d4 = 0;
local_e0 = *(undefined4 *)(this_00 + 0x2e8);
local_d0 = 1;
local_cf = 0;
ForEachSurvivor<ClosestVisibleSurvivorScan>((ClosestVisibleSurvivorScan *)&local_e8);
piVar13 = (int *)&stack0xfffffe94;
if (local_dc != (int *)0x0) {
pcVar3 = *(code **)(*(int *)this_00 + 0x430);
(**(code **)(*local_dc + 0x234))();
/* try { // try from 004dbe38 to 004dbe39 has its CatchHandler @ 004dc859 */
cVar6 = (*pcVar3)();
piVar13 = (int *)&stack0xfffffe90;
if (cVar6 != '\0') {
pcVar3 = *(code **)(*local_dc + 0x7b4);
CAI_Concept::CAI_Concept(local_70,"WarnSpitterIncoming");
(*pcVar3)();
piVar13 = (int *)&stack0xfffffe90;
}
}
if (*(float *)(this + 0x468) != -1.0) {
iVar8 = *(int *)(this + 0x460);
piVar13[1] = (int)(this + 0x468);
*piVar13 = (int)(this + 0x460);
pcVar3 = *(code **)(iVar8 + 4);
piVar13[-1] = 0x4dc364;
(*pcVar3)();
*(undefined4 *)(this + 0x468) = 0xbf800000;
}
fVar1 = *(float *)(z_spit_velocity._28_4_ + 0x2c);
piVar13[1] = (int)this;
*piVar13 = (int)&local_128;
piVar13[-1] = 0x4dbed8;
uVar7 = GetSpitSourcePosition();
*piVar13 = uVar7;
iVar8 = *(int *)this_00;
*piVar13 = (int)this_00;
pcVar3 = *(code **)(iVar8 + 0x778);
piVar13[-1] = 0x4dbee4;
cVar6 = (*pcVar3)();
if (cVar6 == '\0') {
iVar8 = *(int *)this_00;
*piVar13 = (int)this_00;
pcVar3 = *(code **)(iVar8 + 0x238);
piVar13[-1] = 0x4dc390;
uVar7 = (*pcVar3)();
piVar13[3] = 0;
piVar13[1] = (int)&local_11c;
*piVar13 = uVar7;
piVar13[2] = 0;
piVar13[-1] = 0x4dc3b2;
AngleVectors((QAngle *)*piVar13,(Vector *)piVar13[1],(Vector *)piVar13[2],(Vector *)piVar13[3]);
iVar8 = *(int *)this_00;
*piVar13 = (int)&local_104;
piVar13[1] = (int)this_00;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-1] = 0x4dc407;
(*pcVar3)();
iVar8 = *(int *)this_00;
piVar13[-1] = (int)&local_110;
*piVar13 = (int)this_00;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-2] = 0x4dc44f;
(*pcVar3)();
local_94 = 0;
piVar13[1] = 0;
*piVar13 = 0;
piVar13[-1] = (int)this_00;
piVar13[-2] = (int)&local_f8;
local_cc = local_110;
local_bc = (local_11c * 16384.0 - local_110) + local_104;
local_c8 = local_10c;
local_c4 = local_108;
local_b4 = (local_114 * 16384.0 - local_108) + local_fc;
local_98 = 0;
local_b8 = (local_118 * 16384.0 - local_10c) + local_100;
local_9c = 0;
local_8c = 0;
local_88 = 1;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
piVar13[-3] = 0x4dc560;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)piVar13[-2],(IHandleEntity *)piVar13[-1],*piVar13,
(_func_bool_IHandleEntity_ptr_int *)piVar13[1]);
iVar8 = *enginetrace;
piVar13[2] = (int)local_70;
piVar13[-2] = (int)enginetrace;
piVar13[1] = (int)&local_f8;
*piVar13 = 0x46004003;
piVar13[-1] = (int)&local_cc;
pcVar3 = *(code **)(iVar8 + 0x14);
piVar13[-3] = 0x4dc58a;
(*pcVar3)();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
piVar13[4] = -0x40800000;
piVar13[3] = 1;
piVar13[2] = 0;
piVar13[1] = 0;
*piVar13 = 0xff;
piVar13[-1] = (int)&local_64;
piVar13[-2] = (int)local_70;
piVar13[-3] = 0x4dc5d3;
DebugDrawLine((Vector *)piVar13[-2],(Vector *)piVar13[-1],*piVar13,piVar13[1],piVar13[2],
SUB41(piVar13[3],0),(float)piVar13[4]);
}
piVar13[-2] = (int)&local_104;
local_104 = local_64 - local_128;
local_100 = local_60 - local_124;
local_fc = local_5c - local_120;
piVar13[-3] = 0x4dc620;
VectorNormalize((Vector *)piVar13[-2]);
piVar13[-1] = 0x41200000;
piVar13[-2] = 0xc1200000;
piVar13[-3] = 0x4dc636;
lVar14 = (longdouble)RandomFloat();
piVar13[-1] = 0x41200000;
piVar13[-2] = 0xc1200000;
piVar13[-3] = 0x4dc660;
lVar15 = (longdouble)RandomFloat();
local_c4 = 0.0;
local_cc = (float)lVar15;
local_f8 = local_104 * fVar1;
local_f4 = local_100 * fVar1;
local_f0 = local_fc * fVar1;
local_c8 = (float)lVar14;
if (((byte)this_00[0x14d] & 8) != 0) {
piVar13[-2] = (int)this_00;
piVar13[-3] = 0x4dc6e5;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)piVar13[-2]);
}
piVar13[2] = (int)this_00;
piVar13[-1] = (int)(this_00 + 0x37c);
piVar13[1] = (int)&local_cc;
*piVar13 = (int)&local_f8;
piVar13[-2] = (int)&local_128;
piVar13[-3] = 0x4dc709;
CSpitterProjectile::Create
((Vector *)piVar13[-2],(QAngle *)piVar13[-1],(Vector *)*piVar13,(Vector *)piVar13[1],
(CBaseCombatCharacter *)piVar13[2]);
piVar13[1] = 4;
*piVar13 = 0;
piVar13[-1] = 0x28;
piVar13[-2] = (int)this_00;
piVar13[-3] = 0x4dc729;
CBasePlayer::RumbleEffect
((CBasePlayer *)piVar13[-2],(uchar)piVar13[-1],(uchar)*piVar13,(uchar)piVar13[1]);
return;
}
piVar13[3] = 0;
piVar13[2] = (int)&Spitter::typeinfo;
piVar13[1] = (int)&CTerrorPlayer::typeinfo;
*piVar13 = (int)this_00;
piVar13[-1] = 0x4dbf0c;
iVar8 = __dynamic_cast();
if (iVar8 == 0) {
return;
}
uVar2 = *(uint *)(iVar8 + 0x4324);
if (uVar2 == 0xffffffff) {
return;
}
uVar10 = uVar2 & 0xfff;
piVar11 = (int *)(g_pEntityList + uVar10 * 0x10 + 4);
if (piVar11 == (int *)0x0) {
return;
}
if (*(uint *)(g_pEntityList + uVar10 * 0x10 + 8) != uVar2 >> 0xc) {
return;
}
iVar4 = *(int *)(g_pEntityList + uVar10 * 0x10 + 4);
if (iVar4 == 0) {
return;
}
if ((*(byte *)(iVar4 + 0x14d) & 8) == 0) {
local_134 = *(float *)(iVar4 + 0x2e0);
local_138 = *(float *)(iVar4 + 0x2e4);
local_130 = *(float *)(iVar4 + 0x2e8);
}
else {
*piVar13 = iVar4;
iVar12 = 0;
piVar13[-1] = 0x4dc743;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar13);
local_134 = *(float *)(iVar4 + 0x2e0);
local_138 = *(float *)(iVar4 + 0x2e4);
local_130 = *(float *)(iVar4 + 0x2e8);
uVar2 = *(uint *)(iVar8 + 0x4324);
if (((uVar2 == 0xffffffff) ||
(piVar11 = (int *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4), piVar11 == (int *)0x0)) ||
(piVar11[1] != uVar2 >> 0xc)) goto LAB_004dbf9f;
}
iVar12 = *piVar11;
LAB_004dbf9f:
if ((*(byte *)(iVar12 + 0x14d) & 8) != 0) {
*piVar13 = iVar12;
piVar13[-1] = 0x4dc7c8;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar13);
}
local_bc = *(float *)(iVar12 + 0x2e0) - local_128;
local_b8 = *(float *)(iVar12 + 0x2e4) - local_124;
local_b4 = *(float *)(iVar12 + 0x2e8);
piVar13[3] = 0;
piVar13[2] = 0;
local_b4 = local_b4 - local_120;
piVar13[1] = (int)this_00;
*piVar13 = (int)&local_f8;
local_cc = local_128;
local_c8 = local_124;
local_c4 = local_120;
local_94 = 0;
local_98 = 0;
local_9c = 0;
local_8c = 0;
local_88 = 1;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
piVar13[-1] = 0x4dc0ae;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)*piVar13,(IHandleEntity *)piVar13[1],piVar13[2],
(_func_bool_IHandleEntity_ptr_int *)piVar13[3]);
iVar4 = *enginetrace;
*piVar13 = (int)enginetrace;
piVar13[4] = (int)local_70;
piVar13[3] = (int)&local_f8;
piVar13[2] = 0x46004003;
piVar13[1] = (int)&local_cc;
pcVar3 = *(code **)(iVar4 + 0x14);
piVar13[-1] = 0x4dc0d8;
(*pcVar3)();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
piVar13[6] = -0x40800000;
piVar13[5] = 1;
piVar13[4] = 0;
piVar13[3] = 0;
piVar13[2] = 0xff;
piVar13[1] = (int)&local_64;
*piVar13 = (int)local_70;
piVar13[-1] = 0x4dc121;
DebugDrawLine((Vector *)*piVar13,(Vector *)piVar13[1],piVar13[2],piVar13[3],piVar13[4],
SUB41(piVar13[5],0),(float)piVar13[6]);
}
if (local_44 < 1.0) {
local_13c = 0;
uVar2 = *(uint *)(iVar8 + 0x4324);
if (((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
local_13c = *(int *)(puVar9 + 4);
}
if (local_24 != local_13c) {
local_130 = local_130 + 50.0;
}
}
*piVar13 = (int)&local_104;
local_104 = local_134 - local_128;
local_100 = local_138 - local_124;
local_fc = local_130 - local_120;
piVar13[-1] = 0x4dc189;
VectorNormalize((Vector *)*piVar13);
piVar13[1] = 0x41200000;
*piVar13 = 0xc1200000;
piVar13[-1] = 0x4dc19f;
lVar14 = (longdouble)RandomFloat();
piVar13[1] = 0x41200000;
*piVar13 = 0xc1200000;
piVar13[-1] = 0x4dc1c9;
lVar15 = (longdouble)RandomFloat();
local_c4 = 0.0;
local_cc = (float)lVar15;
local_f8 = local_104 * fVar1;
local_f4 = local_100 * fVar1;
local_f0 = local_fc * fVar1;
local_c8 = (float)lVar14;
if (((byte)this_00[0x14d] & 8) != 0) {
*piVar13 = (int)this_00;
piVar13[-1] = 0x4dc24e;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar13);
}
piVar13[4] = (int)this_00;
piVar13[1] = (int)(this_00 + 0x37c);
piVar13[3] = (int)&local_cc;
piVar13[2] = (int)&local_f8;
*piVar13 = (int)&local_128;
piVar13[-1] = 0x4dc272;
CSpitterProjectile::Create
((Vector *)*piVar13,(QAngle *)piVar13[1],(Vector *)piVar13[2],(Vector *)piVar13[3],
(CBaseCombatCharacter *)piVar13[4]);
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.