CTerrorGameMovement::OnLadder
0x004f8bb0 · 957 bytes · __thiscall
_ZN19CTerrorGameMovement8OnLadderER10CGameTrace
Decompiled
undefined (2 params)
/* CTerrorGameMovement::OnLadder(CGameTrace&) */
bool __thiscall CTerrorGameMovement::OnLadder(CTerrorGameMovement *this,CGameTrace *param_1)
{
int *piVar1;
uint uVar2;
char cVar3;
char cVar4;
int iVar5;
CBaseEntity *pCVar6;
undefined *puVar7;
int iVar8;
float fVar9;
float fVar10;
float fVar11;
float fVar12;
float fVar13;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if ((((*(float *)(param_1 + 0x2c) != 1.0) &&
(iVar5 = CTerrorPlayer::GetStaggerDir(*(CTerrorPlayer **)(this + 0x810)), iVar5 == 0)) &&
(cVar3 = CTerrorPlayer::IsAbleToMove(*(CTerrorPlayer **)(this + 0x810)), cVar3 != '\0')) &&
((iVar5 = CMultiPlayerAnimState::GetMainActivity
(*(CMultiPlayerAnimState **)(*(int *)(this + 0x810) + 0x2910)),
5 < iVar5 - 0x209U &&
(cVar3 = CCSGameMovement::OnLadder((CCSGameMovement *)this,param_1), cVar3 != '\0')))) {
if ((*(int *)(param_1 + 0x4c) == 0) ||
(pCVar6 = (CBaseEntity *)
__dynamic_cast(*(int *)(param_1 + 0x4c),&CBaseEntity::typeinfo,
&CFuncSimpleLadder::typeinfo,0), pCVar6 == (CBaseEntity *)0x0)) {
iVar5 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 4));
cVar4 = IsASurvivorTeam(iVar5);
if (cVar4 != '\0') {
iVar5 = _V_strcmp(*(char **)(param_1 + 0x3c),"TOOLS/CLIMB_VERSUS");
if (iVar5 == 0) {
return false;
}
iVar5 = _V_strcmp(*(char **)(param_1 + 0x3c),"noclimb");
if (iVar5 == 0) {
return false;
}
}
}
else {
iVar5 = CBaseEntity::GetTeamNumber(pCVar6);
if (iVar5 != 0) {
iVar5 = CBaseEntity::GetTeamNumber(pCVar6);
iVar8 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 4));
if (iVar5 != iVar8) {
return false;
}
}
local_34 = *(float *)(pCVar6 + 0x440);
local_30 = *(float *)(pCVar6 + 0x444);
local_2c = *(float *)(pCVar6 + 0x448);
local_28 = *(float *)(param_1 + 0x18);
local_24 = *(float *)(param_1 + 0x1c);
local_20 = *(float *)(param_1 + 0x20);
if ((local_2c < 1.0) && (local_20 < 1.0)) {
local_20 = 0.0;
local_2c = 0.0;
VectorNormalize((Vector *)&local_34);
VectorNormalize((Vector *)&local_28);
if ((local_2c < 1.0) &&
(local_24 * local_30 + local_28 * local_34 + local_2c * local_20 < 0.9)) {
return false;
}
}
}
piVar1 = *(int **)(this + 4);
pCVar6 = (CBaseEntity *)0x0;
if (piVar1 != (int *)0x0) {
cVar4 = (**(code **)(*piVar1 + 0x16c))(piVar1);
pCVar6 = *(CBaseEntity **)(this + 4);
if (cVar4 != '\0') {
if ((pCVar6 == (CBaseEntity *)0x0) ||
(cVar4 = (**(code **)(*(int *)pCVar6 + 0x16c))(pCVar6), cVar4 == '\0')) {
pCVar6 = (CBaseEntity *)0x0;
}
uVar2 = *(uint *)(pCVar6 + 0x33c4);
if ((((uVar2 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) {
return false;
}
pCVar6 = *(CBaseEntity **)(this + 4);
}
}
if (pCVar6[0x186] == (CBaseEntity)0x9) {
return (bool)cVar3;
}
iVar5 = CBaseEntity::GetGroundEntity(pCVar6);
if (iVar5 == 0) {
return (bool)cVar3;
}
AngleVectors((QAngle *)(*(int *)(this + 8) + 0x4c),(Vector *)&local_28);
if (ABS(local_20) != 1.0) {
fVar9 = SQRT(local_28 * local_28 + local_24 * local_24);
fVar10 = 0.0;
if (fVar9 == 0.0) {
fVar9 = 0.0;
local_28 = 0.0;
}
else {
fVar9 = 1.0 / fVar9;
local_28 = local_28 * fVar9;
fVar9 = fVar9 * local_24;
}
fVar11 = -*(float *)(param_1 + 0x1c);
fVar12 = -*(float *)(param_1 + 0x18);
fVar13 = SQRT(fVar12 * fVar12 + fVar11 * fVar11);
if (fVar13 == 0.0) {
fVar12 = 0.0;
}
else {
fVar13 = 1.0 / fVar13;
fVar12 = fVar12 * fVar13;
fVar10 = fVar13 * fVar11;
}
return *(float *)(ZombieMinLadderMountDot._28_4_ + 0x2c) <= fVar10 * fVar9 + fVar12 * local_28
;
}
}
return false;
}
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.