L L4D2node

SurvivorCollectObject::OnMoveToFailure

0x0092a3a0 · 341 bytes · __cdecl

_ZN21SurvivorCollectObject15OnMoveToFailureEP11SurvivorBotPK4Path17MoveToFailureType

Decompiled

undefined (3 params)

/* SurvivorCollectObject::OnMoveToFailure(SurvivorBot*, Path const*, MoveToFailureType) */

undefined4 * SurvivorCollectObject::OnMoveToFailure(undefined4 *param_1,int param_2,int *param_3)

{
  uint uVar1;
  int *piVar2;
  char cVar3;
  undefined4 uVar4;
  undefined *puVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  Color local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar1 = *(uint *)(param_2 + 0x34);
  if ((((uVar1 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) ||
     (piVar2 = *(int **)(puVar5 + 4), piVar2 == (int *)0x0)) {
    *param_1 = 3;
    param_1[1] = 0;
    param_1[2] = "Stuck trying to collect NULL item";
    param_1[3] = 3;
  }
  else {
    (**(code **)(*piVar2 + 0x1ac))(piVar2,param_3,param_3,1,0);
    (**(code **)(*param_3 + 0x6e8))(param_3,piVar2,3);
    cVar3 = INextBot::IsDebugging((INextBot *)(param_3 + 0x100a),1);
    if (cVar3 != '\0') {
      puVar6 = &DAT_00d539c2;
      if ((undefined1 *)piVar2[0x1f] != (undefined1 *)0x0) {
        puVar6 = (undefined1 *)piVar2[0x1f];
      }
      uVar4 = (**(code **)(*param_3 + 0xb8))(param_3);
      local_24 = 0xff;
      local_23 = 100;
      local_22 = 0;
      local_21 = 0xff;
      ConColorMsg(&local_24,"%3.2f: WARNING: %s collected %s because path to it failed!\n",
                  (double)*(float *)(gpGlobals + 0xc),uVar4,puVar6);
    }
    *param_1 = 3;
    param_1[1] = 0;
    param_1[2] = "Stuck trying to collect an item";
    param_1[3] = 3;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)