CommandNavCenterInWorld
0x007088c0 · 969 bytes · unknown
_Z23CommandNavCenterInWorldv
Decompiled
undefined (0 params)
/* WARNING: Removing unreachable block (ram,0x00708956) */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* CommandNavCenterInWorld() */
void CommandNavCenterInWorld(void)
{
undefined4 *puVar1;
float fVar2;
float fVar3;
float fVar4;
byte *pbVar5;
int *piVar6;
char cVar7;
CBaseEntity *this;
int iVar8;
int iVar9;
int iVar10;
float local_40 [3];
float local_34 [3];
float local_28 [6];
cVar7 = UTIL_IsCommandIssuedByServerAdmin();
if ((cVar7 != '\0') &&
(this = (CBaseEntity *)UTIL_GetListenServerHost(), iVar9 = TheNavMesh, iVar10 = DAT_00fe6000,
this != (CBaseEntity *)0x0)) {
*(undefined4 *)(TheNavMesh + 0x4c4) = 0;
*(undefined4 *)(iVar9 + 0x470) = 0;
*(undefined4 *)(iVar9 + 0x47c) = 4;
*(undefined4 *)(iVar9 + 0x458) = 0;
*(undefined1 *)(iVar9 + 0x4fc) = 0;
*(undefined1 *)(iVar9 + 0x4fd) = 0;
*(undefined1 *)(iVar9 + 0x4fe) = 0;
if (0 < iVar10) {
iVar10 = 1;
CNavArea::GetExtent((CNavArea *)*TheNavAreas,(Extent *)local_34);
if (1 < DAT_00fe6000) {
do {
iVar9 = TheNavAreas[iVar10];
local_40[0] = *(float *)(iVar9 + 4);
local_40[1] = (float)*(undefined4 *)(iVar9 + 8);
local_40[2] = (float)*(undefined4 *)(iVar9 + 0xc);
iVar8 = 0;
do {
fVar2 = local_40[iVar8];
if (*(float *)((Extent *)local_34 + iVar8 * 4) <= fVar2) {
if (local_28[iVar8] <= fVar2 && fVar2 != local_28[iVar8]) {
local_28[iVar8] = fVar2;
}
}
else {
*(float *)((Extent *)local_34 + iVar8 * 4) = fVar2;
}
iVar8 = iVar8 + 1;
} while (iVar8 != 3);
fVar2 = *(float *)(iVar9 + 0x10);
fVar3 = *(float *)(iVar9 + 8);
fVar4 = *(float *)(iVar9 + 0x24);
if (fVar2 < local_34[0]) {
local_34[0] = fVar2;
if (local_34[1] <= fVar3) goto LAB_007089de;
LAB_00708c6c:
local_34[1] = fVar3;
if (fVar4 < local_34[2]) goto LAB_007089f8;
LAB_00708c80:
if (local_28[2] < fVar4) {
local_28[2] = fVar4;
}
}
else {
if (local_28[0] < fVar2) {
local_28[0] = fVar2;
}
if (fVar3 < local_34[1]) goto LAB_00708c6c;
LAB_007089de:
if (local_28[1] < fVar3) {
local_28[1] = fVar3;
}
if (local_34[2] <= fVar4) goto LAB_00708c80;
LAB_007089f8:
local_34[2] = fVar4;
}
fVar2 = *(float *)(iVar9 + 4);
fVar3 = *(float *)(iVar9 + 0x14);
fVar4 = *(float *)(iVar9 + 0x28);
if (fVar2 < local_34[0]) {
local_34[0] = fVar2;
}
else if (local_28[0] < fVar2) {
local_28[0] = fVar2;
}
if (fVar3 < local_34[1]) {
local_34[1] = fVar3;
}
else if (local_28[1] < fVar3) {
local_28[1] = fVar3;
}
if (local_34[2] <= fVar4) {
if (local_28[2] < fVar4) {
local_28[2] = fVar4;
}
}
else {
local_34[2] = fVar4;
}
local_40[0] = *(float *)(iVar9 + 0x10);
local_40[1] = (float)*(undefined4 *)(iVar9 + 0x14);
local_40[2] = (float)*(undefined4 *)(iVar9 + 0x18);
iVar9 = 0;
do {
fVar2 = local_40[iVar9];
if (*(float *)((Extent *)local_34 + iVar9 * 4) <= fVar2) {
if (local_28[iVar9] <= fVar2 && fVar2 != local_28[iVar9]) {
local_28[iVar9] = fVar2;
}
}
else {
*(float *)((Extent *)local_34 + iVar9 * 4) = fVar2;
}
iVar9 = iVar9 + 1;
} while (iVar9 != 3);
iVar10 = iVar10 + 1;
} while (iVar10 < DAT_00fe6000);
}
}
pbVar5 = *(byte **)(gpGlobals + 0x58);
if ((((pbVar5 != (byte *)0x0) && ((*pbVar5 & 2) == 0)) &&
(piVar6 = *(int **)(pbVar5 + 0xc), piVar6 != (int *)0x0)) &&
(iVar10 = (**(code **)(*piVar6 + 0x18))(piVar6), iVar10 != 0)) {
iVar10 = __dynamic_cast(iVar10,&CBaseEntity::typeinfo,&CWorld::typeinfo,0);
if (iVar10 != 0) {
local_40[2] = 0.0;
local_40[1] = ((*(float *)(iVar10 + 0x458) + *(float *)(iVar10 + 0x44c)) -
(local_28[1] + local_34[1])) * 0.5;
local_40[0] = ((*(float *)(iVar10 + 0x454) + *(float *)(iVar10 + 0x448)) -
(local_28[0] + local_34[0])) * 0.5;
if (0 < DAT_00fe6000) {
iVar10 = 0;
do {
puVar1 = TheNavAreas + iVar10;
iVar10 = iVar10 + 1;
CNavArea::Shift((CNavArea *)*puVar1,(Vector *)local_40);
} while (iVar10 < DAT_00fe6000);
}
CBaseEntity::EmitSound(this,"EDIT_END_AREA.Creating",0.0,(float *)0x0);
Msg("Shifting mesh by %f,%f\n",(double)local_40[0],(double)local_40[1]);
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.