PlayerLocomotion::ApproachDescendingLadder
0x0076c390 · 995 bytes · __thiscall
_ZN16PlayerLocomotion24ApproachDescendingLadderEv
Decompiled
undefined (1 param)
/* PlayerLocomotion::ApproachDescendingLadder() */
undefined4 __thiscall PlayerLocomotion::ApproachDescendingLadder(PlayerLocomotion *this)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
char cVar5;
undefined4 uVar6;
int iVar7;
int *piVar8;
float *pfVar9;
INextBot *this_00;
longdouble lVar10;
float local_24;
float local_20;
float local_1c;
float local_18;
float local_14;
float local_10;
uVar6 = 0;
if (*(int *)(this + 0xa8) != 0) {
iVar7 = (**(code **)(*(int *)this + 300))(this);
fVar1 = *(float *)(iVar7 + 8);
fVar2 = *(float *)(*(int *)(this + 0xa8) + 0x18);
lVar10 = (longdouble)(**(code **)(*(int *)this + 0x134))(this);
if ((float)lVar10 + fVar2 < fVar1) {
iVar7 = *(int *)(this + 0xa8);
piVar8 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
piVar8 = (int *)(**(code **)(*piVar8 + 0xc4))(piVar8);
lVar10 = (longdouble)(**(code **)(*piVar8 + 0x118))(piVar8);
fVar1 = *(float *)(iVar7 + 0x40);
fVar2 = *(float *)(*(int *)(this + 0xa8) + 4);
fVar3 = *(float *)(iVar7 + 0x44);
fVar4 = *(float *)(*(int *)(this + 0xa8) + 8);
pfVar9 = (float *)(**(code **)(*(int *)this + 300))(this);
local_1c = 0.0;
local_24 = (fVar2 - *pfVar9) + fVar1 * (float)lVar10 * 0.25;
local_20 = (fVar4 - pfVar9[1]) + (float)lVar10 * 0.25 * fVar3;
lVar10 = (longdouble)VectorNormalize((Vector *)&local_24);
if ((float)lVar10 < 10.0) {
pfVar9 = (float *)(**(code **)(*(int *)this + 0x14c))(this);
fVar1 = *pfVar9;
fVar2 = pfVar9[1];
fVar3 = pfVar9[2];
pfVar9 = (float *)(**(code **)(*(int *)this + 300))(this);
local_18 = fVar1 * 100.0 + *pfVar9;
local_14 = fVar2 * 100.0 + pfVar9[1];
local_10 = fVar3 * 100.0 + pfVar9[2];
}
else {
iVar7 = *(int *)(this + 0xa8);
fVar1 = *(float *)(iVar7 + 0x40);
fVar2 = *(float *)(iVar7 + 0x48);
local_14 = *(float *)(iVar7 + 0x44) * 100.0;
if (local_20 * *(float *)(iVar7 + 0x44) + local_24 * fVar1 + local_1c * fVar2 < 0.0) {
local_14 = *(float *)(iVar7 + 8) - local_14;
local_10 = *(float *)(iVar7 + 0xc) - fVar2 * 100.0;
local_18 = *(float *)(iVar7 + 4) - fVar1 * 100.0;
}
else {
local_14 = local_14 + *(float *)(iVar7 + 8);
local_10 = fVar2 * 100.0 + *(float *)(iVar7 + 0xc);
local_18 = fVar1 * 100.0 + *(float *)(iVar7 + 4);
}
}
(**(code **)(*(int *)this + 0x120))(this,&local_18);
(**(code **)(*(int *)this + 0xb4))(this,&local_18,0x4b189680);
piVar8 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
iVar7 = (**(code **)(*piVar8 + 0xb4))(piVar8);
uVar6 = 4;
if (*(char *)(iVar7 + 0x186) != '\t') {
this_00 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
cVar5 = INextBot::IsDebugging(this_00,0x10);
uVar6 = 2;
if (cVar5 != '\0') {
piVar8 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
iVar7 = (**(code **)(*piVar8 + 0xb4))(piVar8);
if (*(int *)(iVar7 + 0x30) == 0) {
iVar7 = 0;
}
else {
iVar7 = *(int *)(iVar7 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
NDebugOverlay::EntityText(iVar7,0,"Approach descending ladder",0.1,0xff,0xff,0xff,0xff);
uVar6 = 2;
}
}
}
else {
lVar10 = (longdouble)CountdownTimer::Now();
if ((float)lVar10 + 2.0 != *(float *)(this + 0xb8)) {
(**(code **)(*(int *)(this + 0xb0) + 4))(this + 0xb0,this + 0xb8);
*(float *)(this + 0xb8) = (float)lVar10 + 2.0;
}
uVar6 = 6;
if (*(float *)(this + 0xb4) != 2.0) {
(**(code **)(*(int *)(this + 0xb0) + 4))(this + 0xb0,this + 0xb4);
*(undefined4 *)(this + 0xb4) = 0x40000000;
return 6;
}
}
}
return uVar6;
}
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.