CCharge::UpdateAbility
0x004d58e0 · 1440 bytes · __thiscall
_ZN7CCharge13UpdateAbilityEv
Decompiled
undefined (1 param)
/* CCharge::UpdateAbility() */
void __thiscall CCharge::UpdateAbility(CCharge *this)
{
CTerrorPlayer *this_00;
bool bVar1;
uint uVar2;
int iVar3;
int *piVar4;
undefined *puVar5;
CTerrorPlayer *pCVar6;
undefined *puVar7;
uint uVar8;
undefined4 *puVar9;
CCharge CVar10;
longdouble lVar11;
float fVar12;
float fVar13;
if (this[0x464] == (CCharge)0x0) {
UpdateChargeTarget(this);
return;
}
uVar2 = *(uint *)(this + 0x44c);
if (uVar2 == 0xffffffff) {
return;
}
puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
if (puVar7 == (undefined *)0xfffffffc) {
return;
}
if (*(uint *)(puVar7 + 8) != uVar2 >> 0xc) {
return;
}
this_00 = *(CTerrorPlayer **)(puVar7 + 4);
if (this_00 == (CTerrorPlayer *)0x0) {
return;
}
if ((this[0x4a4] != (CCharge)0x0) &&
((((uVar2 = *(uint *)(this_00 + 0x2a48), uVar2 == 0xffffffff ||
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)))) goto LAB_004d5977;
if ((*(float *)(z_charge_duration._28_4_ + 0x2c) <=
*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x460)) && (((byte)this_00[0x150] & 1) != 0))
{
uVar2 = *(uint *)(this_00 + 0x2a48);
if (uVar2 == 0xffffffff) {
LAB_004d5977:
EndCharge(this);
return;
}
uVar8 = uVar2 & 0xfff;
puVar9 = (undefined4 *)(g_pEntityList + uVar8 * 0x10 + 4);
if (((puVar9 == (undefined4 *)0x0) ||
(*(uint *)(g_pEntityList + uVar8 * 0x10 + 8) != uVar2 >> 0xc)) ||
(*(int *)(g_pEntityList + uVar8 * 0x10 + 4) == 0)) goto LAB_004d5977;
fVar13 = *(float *)(this + 0x4b0);
if (((byte)this_00[0x14d] & 8) == 0) {
bVar1 = 360.0 < fVar13 - *(float *)(this_00 + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_00);
uVar2 = *(uint *)(this_00 + 0x2a48);
bVar1 = 360.0 < fVar13 - *(float *)(this_00 + 0x2e8);
pCVar6 = (CTerrorPlayer *)0x0;
if (((uVar2 == 0xffffffff) ||
(puVar9 = (undefined4 *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4),
puVar9 == (undefined4 *)0x0)) || (puVar9[1] != uVar2 >> 0xc)) goto LAB_004d5a2b;
}
pCVar6 = (CTerrorPlayer *)*puVar9;
LAB_004d5a2b:
CTerrorPlayer::OnSlammedSurvivor(this_00,pCVar6,false,bVar1);
return;
}
lVar11 = (longdouble)CountdownTimer::Now();
puVar7 = g_pEntityList;
if ((float)lVar11 < *(float *)(this + 0x498)) {
uVar2 = *(uint *)(this_00 + 0x2a48);
if (uVar2 != 0xffffffff) {
piVar4 = (int *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4);
if ((piVar4 != (int *)0x0) && (piVar4[1] == uVar2 >> 0xc)) goto LAB_004d5c60;
goto LAB_004d5b9e;
}
}
else {
uVar2 = *(uint *)(this_00 + 0x2a48);
if (uVar2 != 0xffffffff) {
uVar8 = uVar2 & 0xfff;
piVar4 = (int *)(g_pEntityList + uVar8 * 0x10 + 4);
if (((piVar4 != (int *)0x0) && (*(uint *)(g_pEntityList + uVar8 * 0x10 + 8) == uVar2 >> 0xc))
&& (*(int *)(g_pEntityList + uVar8 * 0x10 + 4) != 0)) {
LAB_004d5c60:
if (*piVar4 != 0) {
fVar13 = (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x460)) /
*(float *)(z_charge_duration._28_4_ + 0x2c);
if (1.0 <= fVar13) {
fVar13 = 1.0;
}
if (fVar13 <= 0.5) {
fVar13 = 0.5;
}
if (1.0 <= fVar13) {
if (((byte)this_00[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this_00);
uVar2 = *(uint *)(this_00 + 0x2a48);
}
puVar7 = g_pEntityList;
if ((((vec3_origin == *(float *)(this_00 + 0x274)) &&
(DAT_01053d4c == *(float *)(this_00 + 0x278))) &&
(DAT_01053d50 == *(float *)(this_00 + 0x27c))) && (((byte)this[0x150] & 1) == 0)) {
if (((uVar2 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
puVar7 == (undefined *)0xfffffffc)) || (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
pCVar6 = (CTerrorPlayer *)0x0;
}
else {
pCVar6 = *(CTerrorPlayer **)(puVar7 + 4);
}
CTerrorPlayer::OnSlammedSurvivor(this_00,pCVar6,false,false);
return;
}
}
}
goto LAB_004d5b9e;
}
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_00);
}
fVar13 = *(float *)(this_00 + 0x2e0);
fVar12 = SQRT((*(float *)(this + 0x478) - fVar13) * (*(float *)(this + 0x478) - fVar13) +
(*(float *)(this + 0x47c) - *(float *)(this_00 + 0x2e4)) *
(*(float *)(this + 0x47c) - *(float *)(this_00 + 0x2e4)) +
(*(float *)(this + 0x480) - *(float *)(this_00 + 0x2e8)) *
(*(float *)(this + 0x480) - *(float *)(this_00 + 0x2e8)));
if (fVar12 < *(float *)(z_charger_impact_epsilon._28_4_ + 0x2c) ||
fVar12 == *(float *)(z_charger_impact_epsilon._28_4_ + 0x2c)) {
ImpactRumble(this);
EndCharge(this);
iVar3 = 0;
do {
if (this[iVar3 + 0x49c] != (CCharge)0x0) {
return;
}
iVar3 = iVar3 + 1;
} while (iVar3 != 8);
ImpactStagger(this);
return;
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_00);
fVar13 = *(float *)(this_00 + 0x2e0);
}
*(float *)(this + 0x478) = fVar13;
*(undefined4 *)(this + 0x47c) = *(undefined4 *)(this_00 + 0x2e4);
*(undefined4 *)(this + 0x480) = *(undefined4 *)(this_00 + 0x2e8);
lVar11 = (longdouble)CountdownTimer::Now();
if ((float)lVar11 + 0.1 != *(float *)(this + 0x498)) {
(**(code **)(*(int *)(this + 0x490) + 4))(this + 0x490,this + 0x498);
*(float *)(this + 0x498) = (float)lVar11 + 0.1;
}
if (*(float *)(this + 0x494) == 0.1) {
uVar2 = *(uint *)(this_00 + 0x2a48);
puVar7 = g_pEntityList;
}
else {
(**(code **)(*(int *)(this + 0x490) + 4))(this + 0x490,this + 0x494);
puVar7 = g_pEntityList;
*(undefined4 *)(this + 0x494) = 0x3dcccccd;
uVar2 = *(uint *)(this_00 + 0x2a48);
}
LAB_004d5b9e:
if (((uVar2 != 0xffffffff) &&
(puVar5 = puVar7 + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) {
CVar10 = (CCharge)(*(int *)(puVar5 + 4) != 0);
goto LAB_004d5bc5;
}
}
CVar10 = (CCharge)0x0;
LAB_004d5bc5:
this[0x4a4] = CVar10;
uVar2 = *(uint *)(this_00 + 0x2a48);
if ((((uVar2 != 0xffffffff) &&
(puVar7 = puVar7 + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) {
DoImpactProbe(this);
return;
}
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.