CLeap::ActivateAbility
0x004d8830 · 1700 bytes · __thiscall
_ZN5CLeap15ActivateAbilityEv
Decompiled
undefined (1 param)
/* CLeap::ActivateAbility() */
void __thiscall CLeap::ActivateAbility(CLeap *this)
{
float fVar1;
uint uVar2;
CBaseEdict *pCVar3;
code *pcVar4;
uint *puVar5;
float fVar6;
char cVar7;
int iVar8;
int *piVar9;
undefined *puVar10;
undefined4 *puVar11;
CBaseEntity *this_00;
longdouble lVar12;
float fVar13;
float fVar14;
CLeap *in_stack_ffffff24;
CBaseEntity *this_01;
Vector *this_02;
float local_ac;
float local_a8;
float local_a4;
float local_a0;
float local_9c;
float local_98;
Vector local_94 [12];
float local_88;
float local_84;
float local_80;
float local_7c;
float local_78;
float local_74;
float local_70;
float local_6c;
float local_68;
float local_5c;
float local_44;
puVar11 = (undefined4 *)&stack0xffffff24;
if (((this[0x47d] == (CLeap)0x0) && (cVar7 = CanLeapAgain(in_stack_ffffff24), cVar7 != '\0')) ||
(cVar7 = (**(code **)(*(int *)this + 0x32c))(), cVar7 != '\0')) {
uVar2 = *(uint *)(this + 0x44c);
this_00 = (CBaseEntity *)0x0;
if (((uVar2 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) {
this_00 = *(CBaseEntity **)(puVar10 + 4);
}
cVar7 = (**(code **)(*(int *)this_00 + 0x6f8))();
if (cVar7 == '\0') {
this_01 = this_00 + 0x32d4;
lVar12 = (longdouble)CountdownTimer::Now();
if ((*(float *)(this_00 + 0x32dc) <= (float)lVar12) &&
(((this[0x47d] == (CLeap)0x0 && (cVar7 = CanLeapAgain((CLeap *)this_01), cVar7 != '\0')) ||
((iVar8 = CBaseEntity::GetGroundEntity(this_00), iVar8 != 0 ||
(this_00[0x186] == (CBaseEntity)0x9)))))) {
if (((vec3_origin == *(float *)(this + 0x490)) && (DAT_01053d4c == *(float *)(this + 0x494))
) && (DAT_01053d50 == *(float *)(this + 0x498))) {
this_02 = (Vector *)this_00;
CBasePlayer::EyeVectors
((CBasePlayer *)this_00,(Vector *)&local_ac,(Vector *)0x0,(Vector *)0x0);
local_a0 = local_ac;
local_9c = local_a8;
local_98 = local_a4;
}
else {
local_70 = *(float *)(this + 0x490);
local_6c = *(float *)(this + 0x494);
local_68 = *(float *)(this + 0x498);
this_02 = (Vector *)&local_70;
VectorNormalize(this_02);
local_a0 = local_70;
local_9c = local_6c;
local_98 = local_68;
}
local_ac = local_a0;
local_a8 = local_9c;
local_a4 = local_98;
if (((this[0x47d] != (CLeap)0x0) || (cVar7 = CanLeapAgain((CLeap *)this_02), cVar7 == '\0'))
|| (0.2 <= *(float *)(this_00 + 0x2324) * local_9c +
*(float *)(this_00 + 0x2320) * local_a0 +
*(float *)(this_00 + 9000) * local_98)) {
fVar1 = *(float *)(ZombieLeapPower._28_4_ + 0x2c);
local_a0 = local_a0 * fVar1;
local_9c = local_9c * fVar1;
local_98 = fVar1 * local_98;
if (this[0x47c] != (CLeap)0x1) {
if (this[0x6c] == (CLeap)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CLeap)((byte)this[0x70] | 1);
}
this[0x47c] = (CLeap)0x1;
}
fVar1 = *(float *)(gpGlobals + 0xc);
if (fVar1 != *(float *)(this + 0x46c)) {
if (this[0x6c] == (CLeap)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CLeap)((byte)this[0x70] | 1);
}
*(float *)(this + 0x46c) = fVar1;
}
if (*(float *)(this + 0x468) != -1.0) {
(**(code **)(*(int *)(this + 0x460) + 4))();
*(undefined4 *)(this + 0x468) = 0xbf800000;
}
iVar8 = CBaseEntity::GetGroundEntity(this_00);
if (iVar8 != 0) {
lVar12 = (longdouble)VectorNormalize((Vector *)&local_a0);
fVar6 = local_98;
fVar1 = (float)lVar12;
puVar11 = (undefined4 *)&stack0xffffff24;
if ((local_98 < 0.0) && (puVar11 = (undefined4 *)&stack0xffffff24, -0.7 < local_98)) {
fVar13 = local_a0 * 5000.0;
fVar14 = local_9c * 5000.0;
(**(code **)(*(int *)this_00 + 0x234))();
local_7c = fVar13 + local_88;
local_78 = fVar14 + local_84;
local_74 = fVar6 * 5000.0 + local_80;
(**(code **)(*(int *)this_00 + 0x234))();
UTIL_TraceLine(local_94,(Vector *)&local_7c,0x202420b,(IHandleEntity *)this_00,0,
(CGameTrace *)&local_70);
puVar11 = (undefined4 *)&stack0xffffff1c;
if ((0.0 < local_44) && (puVar11 = (undefined4 *)&stack0xffffff1c, local_44 < 1.0)) {
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
local_98 = (float)((uint)local_98 &
-(uint)(local_5c < *(float *)(this_00 + 0x2e8) - 20.0));
puVar11 = (undefined4 *)&stack0xffffff1c;
}
}
local_a0 = local_a0 * fVar1;
local_9c = local_9c * fVar1;
local_98 = fVar1 * local_98;
}
*puVar11 = this_00;
puVar11[-1] = 0x4d8aaa;
piVar9 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)*puVar11);
if (piVar9 != (int *)0x0) {
iVar8 = *piVar9;
puVar11[1] = 0x1f8;
*puVar11 = piVar9;
pcVar4 = *(code **)(iVar8 + 0x3f0);
puVar11[-1] = 0x4d8ac1;
(*pcVar4)();
}
fVar13 = local_98;
fVar6 = local_9c;
fVar1 = local_a0;
if (((local_a0 != *(float *)(this + 0x470)) || (local_9c != *(float *)(this + 0x474))) ||
(local_98 != *(float *)(this + 0x478))) {
if (this[0x6c] == (CLeap)0x0) {
puVar5 = *(uint **)(this + 0x30);
if (puVar5 != (uint *)0x0) {
*puVar5 = *puVar5 | 0x101;
*puVar11 = puVar5;
puVar11[-1] = 0x4d8c1f;
iVar8 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*puVar11);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CLeap)((byte)this[0x70] | 1);
}
*(float *)(this + 0x470) = fVar1;
*(float *)(this + 0x474) = fVar6;
*(float *)(this + 0x478) = fVar13;
}
this[0x48c] = (CLeap)0x0;
this[0x48d] = (CLeap)0x0;
this[0x47d] = (CLeap)0x0;
*puVar11 = this;
puVar11[-1] = 0x4d8b1d;
CBaseAbility::ActivateAbility((CBaseAbility *)*puVar11);
}
}
}
}
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.