L L4D2node

NextBotCombatCharacter::DoThink

0x00752000 · 647 bytes · __thiscall

_ZN22NextBotCombatCharacter7DoThinkEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* NextBotCombatCharacter::DoThink() */

void __thiscall NextBotCombatCharacter::DoThink(NextBotCombatCharacter *this)

{
  uint *puVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  char cVar5;
  int *piVar6;
  int iVar7;
  INextBot *pIVar8;
  INextBot *this_00;
  int local_30;
  undefined4 local_24;
  undefined4 local_20;
  
  local_24 = 0;
  local_20 = 0;
  if (_towlower == 0) {
    local_30 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_24,0,0,0,0,"/data/src/game/server/nextbot/nextbot.cpp",0x138,
               &DoThink()::tm_fmt,"(%s)%s","NextBotCombatCharacter::DoThink",
               "NextBotCombatCharacter::DoThink");
    local_30 = _towlower;
  }
  uVar4 = local_20;
  uVar3 = local_24;
  iVar2 = _DAT_0105db00;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 007521e6 to 00752246 has its CatchHandler @ 00752324 */
    iVar7 = ThreadGetCurrentId();
    if (iVar2 == iVar7) {
      if ((char *)*_DAT_0105d15c != "NextBotCombatCharacter::DoThink") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca89e4,(char *)0x0,0xca89e4);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 007520ce to 00752150 has its CatchHandler @ 0075229a */
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  this_00 = (INextBot *)(this + 0x1a3c);
  pIVar8 = this_00;
  cVar5 = INextBot::BeginUpdate(this_00);
  if (cVar5 != '\0') {
    if (this[0x1c70] != (NextBotCombatCharacter)0x0) {
      this[0x1c70] = (NextBotCombatCharacter)0x0;
      (**(code **)(*(int *)(this + 0x1a3c) + 0x68))(this_00);
      for (piVar6 = (int *)(**(code **)(*(int *)(this + 0x1a3c) + 8))(this_00); piVar6 != (int *)0x0
          ; piVar6 = (int *)(**(code **)(*(int *)(this + 0x1a3c) + 0xc))(this_00,piVar6)) {
        (**(code **)(*piVar6 + 0x68))(piVar6);
      }
    }
    (**(code **)(*(int *)this + 0x538))(this);
    if ((*(int *)(NextBotStop._28_4_ + 0x30) == 0) && (((byte)this[0x150] & 0x20) == 0)) {
                    /* try { // try from 0075226e to 00752273 has its CatchHandler @ 0075229a */
      (**(code **)(*(int *)(this + 0x1a3c) + 0xa8))(this_00);
    }
    INextBot::EndUpdate();
    pIVar8 = this_00;
  }
  iVar2 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar7 = ThreadGetCurrentId(pIVar8);
    if (iVar2 == iVar7) {
      cVar5 = CVProfNode::ExitScope();
      if (cVar5 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_30 != 0) {
    (**(code **)(local_30 + 0x54))(local_30,uVar3,uVar4,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)