CNavMesh::CommandNavMark
0x0070fba0 · 1090 bytes · __thiscall
_ZN8CNavMesh14CommandNavMarkERK8CCommand
Decompiled
undefined (2 params)
/* CNavMesh::CommandNavMark(CCommand const&) */
void __thiscall CNavMesh::CommandNavMark(CNavMesh *this,CCommand *param_1)
{
CBaseEntity *this_00;
int iVar1;
int iVar2;
uint uVar3;
int iVar4;
int iVar5;
long lVar6;
char *__nptr;
CNavArea *local_20 [4];
this_00 = (CBaseEntity *)UTIL_GetListenServerHost();
if ((this_00 == (CBaseEntity *)0x0) || (*(int *)(this + 0x458) != 0)) {
return;
}
iVar2 = *(int *)(this + 0x4e0);
if (iVar2 != 0) {
if (iVar2 < 1) {
LAB_0070fc00:
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Enable",0.0,(float *)0x0);
AddToSelectedSet(this,*(CNavArea **)(this + 0x474));
return;
}
if (*(int *)(this + 0x474) != **(int **)(this + 0x4d4)) {
iVar1 = 0;
do {
iVar1 = iVar1 + 1;
if (iVar1 == iVar2) goto LAB_0070fc00;
} while (*(int *)(this + 0x474) != (*(int **)(this + 0x4d4))[iVar1]);
}
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Disable",0.0,(float *)0x0);
local_20[0] = *(CNavArea **)(this + 0x474);
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::FindAndRemove
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(this + 0x4d4),local_20);
return;
}
FindActiveNavArea(this);
if ((*(int *)(this + 0x470) != 0) || (*(int *)(this + 0x4c4) != 0)) {
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Enable",0.0,(float *)0x0);
Msg("Area unmarked.\n");
*(undefined4 *)(this + 0x4c4) = 0;
*(undefined4 *)(this + 0x470) = 0;
goto LAB_0070fc96;
}
iVar2 = *(int *)param_1;
if (iVar2 < 2) {
if (*(int *)(this + 0x474) == 0) {
if (*(int *)(this + 0x4bc) != 0) {
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Disable",0.0,(float *)0x0);
iVar2 = *(int *)(this + 0x4bc);
*(undefined4 *)(this + 0x470) = 0;
*(undefined4 *)(this + 0x47c) = 4;
*(int *)(this + 0x4c4) = iVar2;
Msg("Marked Ladder is connected to %d Areas\n",
(*(int *)(iVar2 + 0x34) != 0) +
(*(int *)(iVar2 + 0x28) != 0) + (*(int *)(iVar2 + 0x24) != 0) +
(*(int *)(iVar2 + 0x2c) != 0) + (*(int *)(iVar2 + 0x30) != 0));
}
goto LAB_0070fc96;
}
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Disable",0.0,(float *)0x0);
*(undefined4 *)(this + 0x4c4) = 0;
*(undefined4 *)(this + 0x470) = *(undefined4 *)(this + 0x474);
LAB_0070fe64:
*(undefined4 *)(this + 0x47c) = 4;
iVar2 = GetMarkedArea(this);
iVar2 = **(int **)(iVar2 + 0x58);
iVar1 = GetMarkedArea(this);
iVar1 = **(int **)(iVar1 + 0x60);
iVar4 = GetMarkedArea(this);
iVar4 = **(int **)(iVar4 + 0x5c);
iVar5 = GetMarkedArea(this);
Msg("Marked Area is connected to %d other Areas\n",
iVar2 + iVar1 + iVar4 + **(int **)(iVar5 + 100));
}
else {
if (*(char **)(param_1 + 0x40c) != "ladder") {
iVar2 = _V_stricmp(*(char **)(param_1 + 0x40c),"ladder");
if (iVar2 != 0) {
if (*(int *)param_1 < 2) {
__nptr = "";
}
else {
__nptr = *(char **)(param_1 + 0x40c);
if (__nptr == (char *)0x0) goto LAB_0070fc96;
}
lVar6 = strtol(__nptr,(char **)0x0,10);
if ((lVar6 == 0) || (DAT_00fe6000 < 1)) goto LAB_0070fc96;
iVar2 = *TheNavAreas;
if (lVar6 != *(int *)(iVar2 + 0x8c)) {
iVar1 = 0;
do {
iVar1 = iVar1 + 1;
if (iVar1 == DAT_00fe6000) goto LAB_0070fc96;
iVar2 = TheNavAreas[iVar1];
} while (lVar6 != *(int *)(iVar2 + 0x8c));
}
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Disable",0.0,(float *)0x0);
*(int *)(this + 0x470) = iVar2;
*(undefined4 *)(this + 0x4c4) = 0;
goto LAB_0070fe64;
}
iVar2 = *(int *)param_1;
}
if ((((2 < iVar2) && (*(char **)(param_1 + 0x410) != (char *)0x0)) &&
(uVar3 = strtol(*(char **)(param_1 + 0x410),(char **)0x0,10), uVar3 != 0)) &&
(iVar2 = GetLadderByID(TheNavMesh,uVar3), iVar2 != 0)) {
CBaseEntity::EmitSound(this_00,"EDIT_MARK.Disable",0.0,(float *)0x0);
*(int *)(this + 0x4c4) = iVar2;
*(undefined4 *)(this + 0x470) = 0;
*(undefined4 *)(this + 0x47c) = 4;
Msg("Marked Ladder is connected to %d Areas\n",
(*(int *)(iVar2 + 0x28) != 0) + (*(int *)(iVar2 + 0x24) != 0) +
(*(int *)(iVar2 + 0x2c) != 0) + (*(int *)(iVar2 + 0x30) != 0) +
(*(int *)(iVar2 + 0x34) != 0));
}
}
LAB_0070fc96:
*(undefined4 *)(this + 0x47c) = 4;
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.