L L4D2node

AttackClosestSurvivor::operator()

0x00875c20 · 313 bytes · __thiscall

_ZN21AttackClosestSurvivorclEP8INextBot

Decompiled

undefined (2 params)

/* AttackClosestSurvivor::TEMPNAMEPLACEHOLDERVALUE(INextBot*) */

undefined4 __thiscall
AttackClosestSurvivor::operator()(AttackClosestSurvivor *this,INextBot *param_1)

{
  char cVar1;
  CBaseEntity *this_00;
  int iVar2;
  int *piVar3;
  CBaseCombatCharacter *pCVar4;
  undefined4 uVar5;
  undefined4 *puVar6;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  int *local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined1 local_10;
  undefined1 local_f;
  
  this_00 = (CBaseEntity *)(**(code **)(*(int *)param_1 + 0xb4))(param_1);
  iVar2 = CBaseEntity::GetTeamNumber(this_00);
  if (iVar2 == 3) {
    piVar3 = (int *)(**(code **)(*(int *)param_1 + 0xb4))(param_1);
    cVar1 = (**(code **)(*piVar3 + 300))(piVar3);
    if (cVar1 == '\0') {
      return 1;
    }
    cVar1 = IsInCommentaryMode();
    if (cVar1 != '\0') {
      uVar5 = (**(code **)(*(int *)param_1 + 0xb4))(param_1);
      piVar3 = (int *)(**(code **)(*(int *)param_1 + 0xb4))(param_1);
      puVar6 = (undefined4 *)(**(code **)(*piVar3 + 0x288))(piVar3);
      local_28 = *puVar6;
      local_24 = puVar6[1];
      local_20 = puVar6[2];
      local_1c = (int *)0x0;
      local_18 = 0x4cbebc20;
      local_10 = 1;
      local_f = 1;
      local_14 = uVar5;
      ForEachSurvivorBot<ClosestSurvivorScan>((ClosestSurvivorScan *)&local_28);
      piVar3 = local_1c;
      if ((local_1c != (int *)0x0) &&
         (cVar1 = (**(code **)(*local_1c + 0x16c))(local_1c), cVar1 != '\0')) goto LAB_00875cb0;
    }
    pCVar4 = (CBaseCombatCharacter *)(**(code **)(*(int *)param_1 + 0xb4))(param_1);
    piVar3 = (int *)CDirectorTacticalServices::GetClosestSurvivor
                              (*(CDirectorTacticalServices **)(TheDirector + 0x628),pCVar4,true,true
                              );
    if (piVar3 != (int *)0x0) {
LAB_00875cb0:
      (**(code **)(*(int *)param_1 + 0x84))(param_1,piVar3);
      *(int *)this = *(int *)this + 1;
      return 1;
    }
  }
  return 1;
}

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)