CNavLadder::DrawLadder
0x00732d00 · 2218 bytes · __thiscall
_ZNK10CNavLadder10DrawLadderEv
Decompiled
undefined (1 param)
/* WARNING: Type propagation algorithm not settling */
/* CNavLadder::DrawLadder() const */
void __thiscall CNavLadder::DrawLadder(CNavLadder *this)
{
float fVar1;
float fVar2;
uint uVar3;
CNavArea *pCVar4;
char cVar5;
CBasePlayer *this_00;
float *pfVar6;
float *pfVar7;
char *__s;
int iVar8;
QAngle *pQVar9;
QAngle *pQVar10;
undefined *puVar11;
int iVar12;
bool bVar13;
bool bVar14;
bool bVar15;
float fVar16;
float fVar17;
Vector local_b0 [12];
float local_a4;
float local_a0;
float local_98;
float local_94;
float local_90;
float local_8c;
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_64;
float local_60;
float local_5c;
float local_58;
float local_54;
float local_50;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c [3];
int local_20;
QAngle local_1c [12];
this_00 = (CBasePlayer *)UTIL_GetListenServerHost();
if (this_00 == (CBasePlayer *)0x0) {
return;
}
(**(code **)(*(int *)this_00 + 0x234))(&local_a4,this_00);
pfVar6 = (float *)CBasePlayer::GetPunchAngle(this_00);
pfVar7 = (float *)(**(code **)(*(int *)this_00 + 0x238))(this_00);
local_2c[0] = *pfVar6 + *pfVar7;
local_2c[1] = pfVar6[1] + pfVar7[1];
local_2c[2] = pfVar6[2] + pfVar7[2];
AngleVectors((QAngle *)local_2c,local_b0);
local_a4 = local_a4 - *(float *)(this + 0x10);
local_a0 = local_a0 - *(float *)(this + 0x14);
fVar17 = SQRT(local_a0 * local_a0 + local_a4 * local_a4);
if (fVar17 == 0.0) {
fVar17 = 0.0;
fVar16 = 0.0;
}
else {
fVar17 = 1.0 / fVar17;
fVar16 = local_a4 * fVar17;
fVar17 = local_a0 * fVar17;
}
fVar1 = *(float *)(this + 0x40);
fVar2 = *(float *)(this + 0x44);
bVar13 = *(int *)(TheNavMesh + 0x458) == 1;
bVar15 = this != *(CNavLadder **)(TheNavMesh + 0x4c4);
bVar14 = this != *(CNavLadder **)(TheNavMesh + 0x4bc);
uVar3 = *(uint *)(this + 0x38);
if ((((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) &&
(*(CBaseEntity **)(puVar11 + 4) != (CBaseEntity *)0x0)) {
CBaseEntity::DrawAbsBoxOverlay(*(CBaseEntity **)(puVar11 + 4));
}
iVar12 = 6;
if (!bVar13 && fVar17 * fVar2 + fVar16 * fVar1 <= 0.0) {
if (bVar13 || bVar15) {
iVar12 = (-(uint)(bVar13 || bVar14) & 2) + 5;
}
}
else if (bVar13 || bVar15) {
iVar12 = (-(uint)(bVar13 || bVar14) & 0xfffffffd) + 5;
}
local_98 = 0.0;
local_94 = 0.0;
local_90 = 0.0;
local_8c = 0.0;
local_88 = 0.0;
local_84 = 0.0;
VectorVectors((Vector *)(this + 0x40),(Vector *)&local_98,(Vector *)&local_8c);
if (local_84 <= 0.0) {
local_8c = 0.0;
local_88 = 0.0;
local_84 = 1.0;
}
fVar17 = *(float *)(this + 0x20) * 0.5;
local_98 = local_98 * fVar17;
local_94 = local_94 * fVar17;
local_90 = fVar17 * local_90;
local_80 = *(float *)(this + 0x10) - local_98;
local_74 = *(float *)(this + 0x10) + local_98;
local_70 = *(float *)(this + 0x14) + local_94;
local_7c = *(float *)(this + 0x14) - local_94;
local_6c = *(float *)(this + 0x18) + local_90;
local_78 = *(float *)(this + 0x18) - local_90;
local_68 = *(float *)(this + 4) - local_98;
local_5c = local_98 + *(float *)(this + 4);
local_64 = *(float *)(this + 8) - local_94;
local_58 = local_94 + *(float *)(this + 8);
local_60 = *(float *)(this + 0xc) - local_90;
local_54 = local_90 + *(float *)(this + 0xc);
__s = "FCVAR_NEVER_AS_STRING";
if ((nav_area_bgcolor[0x15] & 0x10) == 0) {
__s = "";
if (*(char **)(nav_area_bgcolor._28_4_ + 0x24) != (char *)0x0) {
__s = *(char **)(nav_area_bgcolor._28_4_ + 0x24);
}
}
iVar8 = sscanf(__s,"%d %d %d %d",(QAngle *)local_2c,local_2c + 1,local_2c + 2,&local_20);
if (iVar8 != 4) goto LAB_00733010;
pQVar9 = (QAngle *)local_2c;
do {
iVar8 = 0;
if (-1 < *(int *)pQVar9) {
iVar8 = *(int *)pQVar9;
}
if (0xff < iVar8) {
iVar8 = 0xff;
}
pQVar10 = pQVar9 + 4;
*(int *)pQVar9 = iVar8;
pQVar9 = pQVar10;
} while (pQVar10 != local_1c);
if (local_20 < 1) goto LAB_00733010;
if (*(uint *)(this + 0x3c) < 4) {
iVar8 = *(int *)(CSWTCH_1176 + *(uint *)(this + 0x3c) * 4);
if (iVar8 == 1) {
fVar17 = 0.0;
fVar16 = 1.0;
}
else if (iVar8 < 2) {
if (iVar8 == 0) goto LAB_00733420;
LAB_007333af:
fVar17 = 0.0;
fVar16 = 0.0;
}
else {
fVar17 = 1.0;
fVar16 = 0.0;
if (iVar8 != 2) {
fVar17 = 0.0;
fVar16 = -1.0;
if (iVar8 != 3) goto LAB_007333af;
}
}
}
else {
LAB_00733420:
fVar17 = -1.0;
fVar16 = 0.0;
}
local_38 = local_74 + fVar16;
local_34 = local_70 + fVar17;
local_30 = local_6c;
local_44 = local_5c + fVar16;
local_40 = local_58 + fVar17;
local_3c = local_54;
local_50 = fVar16 + local_68;
local_4c = fVar17 + local_64;
local_48 = local_60;
NDebugOverlay::Triangle
((Vector *)&local_50,(Vector *)&local_44,(Vector *)&local_38,(int)local_2c[0],
(int)local_2c[1],(int)local_2c[2],local_20,true,0.15);
local_38 = local_68 + fVar16;
local_34 = local_64 + fVar17;
local_30 = local_60;
local_44 = local_80 + fVar16;
local_50 = fVar16 + local_74;
local_40 = local_7c + fVar17;
local_4c = fVar17 + local_70;
local_3c = local_78;
local_48 = local_6c;
NDebugOverlay::Triangle
((Vector *)&local_50,(Vector *)&local_44,(Vector *)&local_38,(int)local_2c[0],
(int)local_2c[1],(int)local_2c[2],local_20,true,0.15);
LAB_00733010:
NavDrawLine(&local_68,&local_80,iVar12);
NavDrawLine(&local_5c,&local_74,iVar12);
if (local_6c < local_54) {
do {
NavDrawLine(&local_74,&local_80,iVar12);
local_74 = local_74 + local_8c * 12.5;
local_80 = local_8c * 12.5 + local_80;
local_70 = local_70 + local_88 * 12.5;
local_7c = local_88 * 12.5 + local_7c;
local_6c = local_6c + local_84 * 12.5;
local_78 = local_84 * 12.5 + local_78;
} while (local_6c < local_54);
}
if (*(int *)(TheNavMesh + 0x458) != 1) {
local_50 = *(float *)(this + 0x10);
local_4c = *(float *)(this + 0x14);
local_48 = *(float *)(this + 0x18);
local_44 = *(float *)(this + 4);
local_40 = *(float *)(this + 8);
local_3c = *(float *)(this + 0xc);
NavDrawLine(&local_44,&local_50,0x10);
pCVar4 = *(CNavArea **)(this + 0x34);
if (pCVar4 != (CNavArea *)0x0) {
fVar17 = local_3c - local_48;
fVar16 = local_48 - *(float *)(pCVar4 + 0x34);
cVar5 = CNavArea::IsConnected(pCVar4,this,0);
local_38 = local_50;
local_30 = (float)(~-(uint)(fVar17 < 37.5) & 0x41c80000 & -(uint)(fVar16 <= 37.5)) + local_48;
local_34 = local_4c;
NavDrawLine(&local_38,pCVar4 + 0x2c,~-(uint)(cVar5 == '\0') + 0x11);
}
if (*(CNavArea **)(this + 0x24) != (CNavArea *)0x0) {
cVar5 = CNavArea::IsConnected(*(CNavArea **)(this + 0x24),this,1);
NavDrawLine(&local_44,*(int *)(this + 0x24) + 0x2c,~-(uint)(cVar5 == '\0') + 0x11);
}
if (*(CNavArea **)(this + 0x28) != (CNavArea *)0x0) {
cVar5 = CNavArea::IsConnected(*(CNavArea **)(this + 0x28),this,1);
NavDrawLine(&local_44,*(int *)(this + 0x28) + 0x2c,~-(uint)(cVar5 == '\0') + 0x11);
}
if (*(CNavArea **)(this + 0x2c) != (CNavArea *)0x0) {
cVar5 = CNavArea::IsConnected(*(CNavArea **)(this + 0x2c),this,1);
NavDrawLine(&local_44,*(int *)(this + 0x2c) + 0x2c,~-(uint)(cVar5 == '\0') + 0x11);
}
if (*(CNavArea **)(this + 0x30) != (CNavArea *)0x0) {
cVar5 = CNavArea::IsConnected(*(CNavArea **)(this + 0x30),this,1);
NavDrawLine(&local_44,*(int *)(this + 0x30) + 0x2c,~-(uint)(cVar5 == '\0') + 0x11);
}
}
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.