L L4D2node

SurvivorDispatchEnemy::UpdateWeaponNotReady

0x0091def0 · 388 bytes · __thiscall

_ZN21SurvivorDispatchEnemy20UpdateWeaponNotReadyEP11SurvivorBotf

Decompiled

undefined (3 params)

/* SurvivorDispatchEnemy::UpdateWeaponNotReady(SurvivorBot*, float) */

SurvivorDispatchEnemy * __thiscall
SurvivorDispatchEnemy::UpdateWeaponNotReady
          (SurvivorDispatchEnemy *this,SurvivorBot *param_1,float param_2)

{
  code *pcVar1;
  int *piVar2;
  int *piVar3;
  int iVar4;
  undefined4 uVar5;
  
  piVar2 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_2);
  if (piVar2 != (int *)0x0) {
    piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x484))(param_2,0);
    if (piVar2 == piVar3) {
      iVar4 = (**(code **)(*piVar2 + 0x638))(piVar2);
      if (iVar4 == 0x15) {
        iVar4 = (**(code **)(*(int *)param_2 + 0x484))(param_2,1);
        if (iVar4 == 0) {
          *(undefined4 *)this = 3;
          *(undefined4 *)(this + 4) = 0;
          *(char **)(this + 8) = "No suitable weapon";
          return this;
        }
        pcVar1 = *(code **)(*(int *)param_2 + 0x474);
        uVar5 = (**(code **)(*(int *)param_2 + 0x484))(param_2,1);
        (*pcVar1)(param_2,uVar5,0);
      }
    }
    else {
      piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x484))(param_2,1);
      if (piVar2 != piVar3) {
        piVar2 = (int *)(**(code **)(*(int *)param_2 + 0x484))(param_2,0);
        if ((piVar2 == (int *)0x0) ||
           (iVar4 = (**(code **)(*piVar2 + 0x638))(piVar2), iVar4 == 0x15)) {
          iVar4 = (**(code **)(*(int *)param_2 + 0x484))(param_2,1);
          if (iVar4 == 0) {
            *(undefined4 *)this = 3;
            *(undefined4 *)(this + 4) = 0;
            *(char **)(this + 8) = "We have no weapons with which to dispatch an enemy.";
            return this;
          }
          (**(code **)(*(int *)param_2 + 0x474))(param_2,iVar4,0);
        }
        else {
          (**(code **)(*(int *)param_2 + 0x474))(param_2,piVar2,0);
        }
        goto LAB_0091df8b;
      }
    }
    param_1[0x45] = (SurvivorBot)0x1;
  }
LAB_0091df8b:
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  return this;
}

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)