CNavArea::MarkAsBlocked
0x00702210 · 1188 bytes · __thiscall
_ZN8CNavArea13MarkAsBlockedEiP11CBaseEntityb
Decompiled
undefined (4 params)
/* CNavArea::MarkAsBlocked(int, CBaseEntity*, bool) */
void __thiscall
CNavArea::MarkAsBlocked(CNavArea *this,int param_1,CBaseEntity *param_2,bool param_3)
{
CNavArea CVar1;
undefined4 uVar2;
uint uVar3;
byte bVar4;
char cVar5;
undefined1 uVar6;
int iVar7;
undefined4 uVar8;
int *piVar9;
int iVar10;
int in_GS_OFFSET;
int local_30 [3];
Color local_24;
undefined1 local_23;
undefined1 local_22;
undefined1 local_21;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName == '\0') &&
(iVar10 = __cxa_guard_acquire(&MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName),
iVar10 != 0)) {
DAT_00fe602c = 0;
MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName = 0;
DAT_00fe6028 = "func_nav_blocker";
__cxa_guard_release(&MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName);
__cxa_atexit(CGameString::~CGameString,
&MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName,&__dso_handle);
}
if ((MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName == '\0') &&
(iVar10 = __cxa_guard_acquire(&MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName),
iVar10 != 0)) {
DAT_00fe601c = 0;
MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName = 0;
DAT_00fe6018 = "script_nav_blocker";
__cxa_guard_release(&MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName);
__cxa_atexit(CGameString::~CGameString,
&MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName,&__dso_handle);
}
if (param_2 != (CBaseEntity *)0x0) {
if (((MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName == 0) ||
(iVar10 = MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName,
DAT_00fe602c != CGameString::gm_iSerialNumber)) && (iVar10 = 0, DAT_00fe6028 != (char *)0x0)
) {
AllocPooledString((char *)local_30);
MarkAsBlocked(int,CBaseEntity*,bool)::funcBlockerClassName = local_30[0];
DAT_00fe602c = CGameString::gm_iSerialNumber;
iVar10 = local_30[0];
}
iVar7 = *(int *)(param_2 + 0x7c);
if (iVar7 != iVar10) {
if (((MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName == 0) ||
(iVar10 = MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName,
DAT_00fe601c != CGameString::gm_iSerialNumber)) &&
(iVar10 = 0, DAT_00fe6018 != (char *)0x0)) {
AllocPooledString((char *)local_30);
DAT_00fe601c = CGameString::gm_iSerialNumber;
iVar7 = *(int *)(param_2 + 0x7c);
MarkAsBlocked(int,CBaseEntity*,bool)::scriptBlockerClassName = local_30[0];
iVar10 = local_30[0];
}
if (iVar10 != iVar7) goto LAB_007022f8;
}
uVar3 = *(uint *)(this + 0x54);
*(uint *)(this + 0x54) = uVar3 | 0x80000000;
iVar10 = __dynamic_cast(param_2,&CBaseEntity::typeinfo,&CFuncNavBlocker::typeinfo,0);
if (*(char *)(iVar10 + 0x460) != '\0') {
uVar6 = 1;
*(uint *)(this + 0x54) = uVar3 | 0x88000000;
goto LAB_007022fc;
}
}
LAB_007022f8:
uVar6 = 0;
LAB_007022fc:
CVar1 = this[0x7f];
bVar4 = (byte)CVar1 >> 1 & 1;
if (param_1 == -1) {
this[0x7f] = (CNavArea)0x3;
}
else {
cVar5 = (char)(param_1 >> 0x1f);
this[0x7f] = (CNavArea)
((byte)CVar1 | (byte)(1 << (((char)param_1 - cVar5 & 1U) + cVar5 & 0x1f)));
}
if (((byte)CVar1 & 1) == 0 && bVar4 == 0) {
if ((param_3) &&
(piVar9 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"nav_blocked",0,&g_NavBlockedEvent),
piVar9 != (int *)0x0)) {
(**(code **)(*piVar9 + 0x30))(piVar9,"area",*(undefined4 *)(this + 0x8c));
(**(code **)(*piVar9 + 0x30))(piVar9,"blocked",1);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar9,0);
iVar10 = *(int *)(nav_debug_blocked._28_4_ + 0x30);
}
else {
iVar10 = *(int *)(nav_debug_blocked._28_4_ + 0x30);
}
if (iVar10 != 0) {
if (param_2 == (CBaseEntity *)0x0) {
local_24 = 0;
local_23 = 0xff;
local_22 = 0x80;
local_21 = 0xff;
ConColorMsg(&local_24,"non-entity blocked area %d\n",*(undefined4 *)(this + 0x8c));
}
else {
uVar2 = *(undefined4 *)(this + 0x8c);
if (*(int *)(param_2 + 0x30) == 0) {
iVar10 = 0;
}
else {
iVar10 = *(int *)(param_2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
uVar8 = CBaseEntity::GetDebugName(param_2);
local_24 = 0;
local_23 = 0xff;
local_22 = 0x80;
local_21 = 0xff;
ConColorMsg(&local_24,"%s %d blocked area %d\n",uVar8,iVar10,uVar2);
}
}
(**(code **)(*TheNavMesh + 0x5c))(TheNavMesh,this,uVar6);
}
else {
if (*(int *)(nav_debug_blocked._28_4_ + 0x30) != 0) {
if (param_2 == (CBaseEntity *)0x0) {
local_24 = 0;
local_23 = 0xff;
local_22 = 0x80;
local_21 = 0xff;
ConColorMsg(&local_24,"DUPE: non-entity blocked area %d\n",*(undefined4 *)(this + 0x8c));
}
else {
uVar2 = *(undefined4 *)(this + 0x8c);
if (*(int *)(param_2 + 0x30) == 0) {
iVar10 = 0;
}
else {
iVar10 = *(int *)(param_2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
uVar8 = CBaseEntity::GetDebugName(param_2);
local_24 = 0;
local_23 = 0xff;
local_22 = 0x80;
local_21 = 0xff;
ConColorMsg(&local_24,"DUPE: %s %d blocked area %d\n",uVar8,iVar10,uVar2);
}
}
if ((((byte)this[0x7f] & 1) != ((byte)CVar1 & 1)) || (((byte)this[0x7f] >> 1 & 1) != bVar4)) {
Warning("MarkAsBlocked: Area %d is already blocked with a different team id! This may cause flow bugs.\n"
,*(undefined4 *)(this + 0x8c));
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.