L L4D2node

CTerrorPlayer::OnNavAreaChanged

0x009deef0 · 2179 bytes · __thiscall

_ZN13CTerrorPlayer16OnNavAreaChangedEP8CNavAreaS1_

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorPlayer::OnNavAreaChanged(CNavArea*, CNavArea*) */

void __thiscall
CTerrorPlayer::OnNavAreaChanged(CTerrorPlayer *this,CNavArea *param_1,CNavArea *param_2)

{
  uint *puVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  longdouble lVar7;
  CTerrorPlayer *pCVar8;
  CTerrorPlayer *pCVar9;
  CNavArea *pCVar10;
  CNavArea *pCVar11;
  CNavArea *pCVar12;
  undefined4 local_44;
  undefined4 local_40;
  CTerrorPlayer *local_3c;
  CNavArea *local_38;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  CTerrorPlayer *local_28;
  CNavArea *local_24;
  CNavArea *local_20;
  
  local_44 = 0;
  local_40 = 0;
  if (_towlower == 0) {
    local_2c = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_44,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",0x803,
               &OnNavAreaChanged(CNavArea*,CNavArea*)::tm_fmt,"(%s)%s",
               "CTerrorPlayer::OnNavAreaChanged","CTerrorPlayer::OnNavAreaChanged");
    local_2c = _towlower;
  }
  iVar5 = _DAT_0105db00;
  local_34 = local_44;
  local_30 = local_40;
                    /* try { // try from 009df616 to 009df676 has its CatchHandler @ 009df830 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    if (*(char **)_DAT_0105d15c != "CTerrorPlayer::OnNavAreaChanged") {
      _DAT_0105d15c =
           (CNavArea *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19b00,(char *)0x0,0xd19b00);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  if (2 < *(int *)(developer._28_4_ + 0x30)) {
    if (param_1 == (CNavArea *)0x0) {
      uVar6 = (**(code **)(*(int *)this + 0xb8))(this);
      DevMsg("%s left the nav mesh\n",uVar6);
    }
    else {
      uVar6 = *(undefined4 *)(param_1 + 0x8c);
                    /* try { // try from 009defc4 to 009df0bd has its CatchHandler @ 009df80c */
      uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
      DevMsg("%s entered nav area %d\n",uVar3,uVar6);
    }
  }
  lVar7 = (longdouble)IntervalTimer::Now();
  if ((float)lVar7 != *(float *)(this + 0x3108)) {
    (**(code **)(*(int *)(this + 0x3104) + 4))(this + 0x3104,this + 0x3108);
    *(float *)(this + 0x3108) = (float)lVar7;
  }
  *(undefined4 *)(this + 0x310c) = 0;
                    /* try { // try from 009df68b to 009df7ca has its CatchHandler @ 009df80c */
  if (((((param_1 == (CNavArea *)0x0) ||
        (cVar2 = (**(code **)(*(int *)this + 300))(this), cVar2 == '\0')) ||
       ((iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 2 ||
        ((this[0x3377] != (CTerrorPlayer)0x0 ||
         (iVar5 = (**(code **)(*(int *)this + 0x5f4))(this), iVar5 == 0)))))) ||
      (iVar5 = __dynamic_cast(param_1,&CNavArea::typeinfo,&TerrorNavArea::typeinfo,0),
      uVar6 = survivor_lazy_active_set._28_4_, iVar5 == 0)) ||
     ((*(uint *)(iVar5 + 300) & 0x10880) != 0)) {
    iVar5 = *(int *)(survivor_lazy_active_set._28_4_ + 0x30);
  }
  else {
    this[0x3377] = (CTerrorPlayer)0x1;
    iVar5 = *(int *)(uVar6 + 0x30);
  }
  if (iVar5 == 0) {
    UpdateActiveSet(this,param_1,param_2);
  }
  else {
    *(CNavArea **)(this + 0x30fc) = param_1;
    if (*(int *)(this + 0x3100) == 0) {
      *(CNavArea **)(this + 0x3100) = param_2;
    }
  }
  local_3c = (CTerrorPlayer *)0x0;
  local_38 = (CNavArea *)0x0;
  if (___atan2f_finite == (CNavArea *)0x0) {
    local_20 = (CNavArea *)0x0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_3c,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",
               0x831,&OnNavAreaChanged(CNavArea*,CNavArea*)::tm_fmt,"(%s)%s","Unaccounted",
               "TheDirector->OnPlayerNavAreaChanged( this, enteredArea, leftArea )");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_3c;
  local_24 = local_38;
                    /* try { // try from 009df5ae to 009df5fc has its CatchHandler @ 009df834 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    if (*(char **)_DAT_0105d15c !=
        "TheDirector->OnPlayerNavAreaChanged( this, enteredArea, leftArea )") {
      _DAT_0105d15c =
           (CNavArea *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19b20,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  pCVar8 = TheDirector;
  pCVar9 = this;
  pCVar10 = param_1;
  pCVar12 = param_2;
                    /* try { // try from 009df104 to 009df108 has its CatchHandler @ 009df7fc */
  CDirector::OnPlayerNavAreaChanged(TheDirector,(CNavArea *)this,param_1);
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    pCVar8 = (CTerrorPlayer *)_DAT_0105d15c;
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
  }
  if (local_20 != (CNavArea *)0x0) {
    pCVar12 = (CNavArea *)0x0;
    pCVar8 = (CTerrorPlayer *)local_20;
    pCVar9 = local_28;
    pCVar10 = local_24;
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  local_3c = (CTerrorPlayer *)0x0;
  local_38 = (CNavArea *)0x0;
  if (___atan2f_finite == (CNavArea *)0x0) {
    local_20 = (CNavArea *)0x0;
  }
  else {
    pCVar9 = (CTerrorPlayer *)&local_3c;
    pCVar12 = (CNavArea *)0x0;
    pCVar10 = (CNavArea *)0x0;
                    /* try { // try from 009df1cb to 009df1cd has its CatchHandler @ 009df80c */
    pCVar8 = (CTerrorPlayer *)___atan2f_finite;
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,pCVar9,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",0x833
               ,&OnNavAreaChanged(CNavArea*,CNavArea*)::tm_fmt,"(%s)%s","Unaccounted",
               "m_vocalizer->OnNavAreaChanged( enteredArea, leftArea )");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_3c;
  local_24 = local_38;
                    /* try { // try from 009df4fe to 009df54c has its CatchHandler @ 009df836 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(pCVar8,pCVar9,pCVar10,pCVar12), iVar5 == iVar4)) {
    if (*(char **)_DAT_0105d15c != "m_vocalizer->OnNavAreaChanged( enteredArea, leftArea )") {
      _DAT_0105d15c =
           (CNavArea *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19b64,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  pCVar12 = *(CNavArea **)(this + 0x3110);
  pCVar10 = param_1;
  pCVar11 = param_2;
                    /* try { // try from 009df211 to 009df215 has its CatchHandler @ 009df820 */
  Vocalizer::OnNavAreaChanged(pCVar12,param_1);
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(pCVar12,pCVar10,pCVar11), iVar5 == iVar4)) {
    pCVar12 = _DAT_0105d15c;
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
  }
  if (local_20 != (CNavArea *)0x0) {
    pCVar12 = local_20;
    pCVar10 = (CNavArea *)local_28;
    pCVar11 = local_24;
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  local_3c = (CTerrorPlayer *)0x0;
  local_38 = (CNavArea *)0x0;
  if (___atan2f_finite == (CNavArea *)0x0) {
    local_20 = (CNavArea *)0x0;
  }
  else {
    pCVar10 = (CNavArea *)&local_3c;
    pCVar11 = (CNavArea *)0x0;
                    /* try { // try from 009df2d9 to 009df2db has its CatchHandler @ 009df80c */
    pCVar12 = ___atan2f_finite;
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,pCVar10,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",
               0x835,&OnNavAreaChanged(CNavArea*,CNavArea*)::tm_fmt,"(%s)%s","Unaccounted",
               "BaseClass::OnNavAreaChanged( enteredArea, leftArea )");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_3c;
  local_24 = local_38;
                    /* try { // try from 009df44e to 009df49c has its CatchHandler @ 009df7d0 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(pCVar12,pCVar10,pCVar11), iVar5 == iVar4)) {
    if (*(char **)_DAT_0105d15c != "BaseClass::OnNavAreaChanged( enteredArea, leftArea )") {
      _DAT_0105d15c =
           (CNavArea *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19b9c,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 009df31a to 009df31e has its CatchHandler @ 009df810 */
  CBasePlayer::OnNavAreaChanged((CNavArea *)this,param_1);
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(this,param_1,param_2), iVar5 == iVar4)) {
    this = (CTerrorPlayer *)_DAT_0105d15c;
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
  }
  if (local_20 != (CNavArea *)0x0) {
    this = (CTerrorPlayer *)local_20;
    param_1 = (CNavArea *)local_28;
    param_2 = local_24;
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(this,param_1,param_2), iVar5 == iVar4)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
  }
  if (local_2c != 0) {
    (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)