L L4D2node

Action<Hunter>::OnDrop

0x00a9bcd0 · 927 bytes · __thiscall

_ZN6ActionI6HunterE6OnDropEP11CBaseEntity

Decompiled

undefined (2 params)

/* Action<Hunter>::OnDrop(CBaseEntity*) */

void __thiscall Action<Hunter>::OnDrop(Action<Hunter> *this,CBaseEntity *param_1)

{
  float fVar1;
  int iVar2;
  code *pcVar3;
  char cVar4;
  uint uVar5;
  undefined1 *puVar6;
  int *piVar7;
  char *pcVar8;
  Action<Hunter> *pAVar9;
  uint *puVar10;
  uint *puVar11;
  int in_GS_OFFSET;
  uint auStack_84 [15];
  int *local_48;
  undefined1 *local_44;
  undefined4 local_40;
  int local_34;
  int *local_30;
  undefined1 *local_2c;
  undefined4 local_28;
  undefined1 local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  puVar11 = auStack_84 + 2;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (this[0x30] != (Action<Hunter>)0x0) {
    local_34 = 0;
    local_30 = (int *)0x0;
    local_2c = (undefined1 *)0x0;
    local_28 = 1;
    pAVar9 = this;
    puVar11 = auStack_84 + 2;
    do {
      puVar10 = puVar11;
      iVar2 = *(int *)(this + 0x1c);
      uVar5 = 0;
      if (iVar2 != 0) {
        puVar10[1] = 0x80;
        *puVar10 = iVar2 + 0x4028;
        puVar10[-1] = 0xa9bd94;
        cVar4 = INextBot::IsDebugging((INextBot *)*puVar10,puVar10[1]);
        if ((cVar4 == '\0') && (*(int *)(NextBotDebugHistory._28_4_ + 0x30) == 0)) {
          uVar5 = *(uint *)(this + 0x1c);
        }
        else {
          iVar2 = *(int *)pAVar9;
          *puVar10 = (uint)pAVar9;
          pcVar3 = *(code **)(iVar2 + 0xac);
          puVar10[-1] = 0xa9bda3;
          auStack_84[0xc] = (*pcVar3)();
          auStack_84[0xd] = *(int *)(this + 8) + 0x11;
          iVar2 = **(int **)(this + 0x1c);
          *puVar10 = (uint)*(int **)(this + 0x1c);
          pcVar3 = *(code **)(iVar2 + 0x9a4);
          puVar10[-1] = 0xa9bdbd;
          uVar5 = (*pcVar3)();
          fVar1 = *(float *)(gpGlobals + 0xc);
          puVar10[8] = auStack_84[0xc];
          puVar10[6] = uVar5;
          puVar10[9] = (uint)"OnDrop";
          *(double *)(puVar10 + 4) = (double)fVar1;
          puVar10[7] = auStack_84[0xd];
          puVar10[3] = (uint)"%3.2f: %s:%s: %s received EVENT %s\n";
          puVar10[2] = (uint)&local_24;
          puVar10[1] = 0x80;
          local_24 = 100;
          local_23 = 100;
          local_22 = 100;
          local_21 = 0xff;
          *puVar10 = *(int *)(this + 0x1c) + 0x4028;
          puVar10[-1] = 0xa9be22;
          INextBot::DebugConColorMsg();
          uVar5 = *(uint *)(this + 0x1c);
        }
      }
      iVar2 = *(int *)pAVar9;
      puVar10[2] = uVar5;
      *puVar10 = (uint)(auStack_84 + 0xe);
      puVar10[3] = (uint)param_1;
      puVar10[1] = (uint)pAVar9;
      pcVar3 = *(code **)(iVar2 + 0x124);
      puVar10[-1] = 0xa9bd4a;
      (*pcVar3)();
      local_30 = local_48;
      local_34 = auStack_84[0xe];
      local_2c = local_44;
      local_28 = local_40;
      if (auStack_84[0xe] != 0) {
        iVar2 = *(int *)(this + 0x1c);
        if (iVar2 != 0) {
          *puVar10 = 1;
          puVar10[-1] = iVar2 + 0x4028;
          puVar10[-2] = 0xa9be50;
          cVar4 = INextBot::IsDebugging((INextBot *)puVar10[-1],*puVar10);
          if (((cVar4 != '\0') || (*(int *)(NextBotDebugHistory._28_4_ + 0x30) != 0)) &&
             (local_34 - 1U < 3)) {
            auStack_84[0xd] = *(int *)(this + 8) + 0x11;
            iVar2 = **(int **)(this + 0x1c);
            puVar10[-1] = (uint)*(int **)(this + 0x1c);
            pcVar3 = *(code **)(iVar2 + 0x9a4);
            puVar10[-2] = 0xa9be8a;
            uVar5 = (*pcVar3)();
            fVar1 = *(float *)(gpGlobals + 0xc);
            puVar10[5] = uVar5;
            puVar10[6] = auStack_84[0xd];
            *(double *)(puVar10 + 3) = (double)fVar1;
            puVar10[2] = (uint)"%3.2f: %s:%s: ";
            puVar10[1] = (uint)&local_24;
            *puVar10 = 1;
            local_24 = 0xff;
            local_23 = 0xff;
            local_22 = 0;
            local_21 = 0xff;
            puVar10[-1] = *(int *)(this + 0x1c) + 0x4028;
            puVar10[-2] = 0xa9bee0;
            INextBot::DebugConColorMsg();
            iVar2 = *(int *)pAVar9;
            puVar10[-1] = (uint)pAVar9;
            pcVar3 = *(code **)(iVar2 + 0xac);
            puVar10[-2] = 0xa9beeb;
            uVar5 = (*pcVar3)();
            puVar10[2] = (uint)"%s ";
            puVar10[3] = uVar5;
            puVar10[1] = (uint)&local_24;
            *puVar10 = 1;
            local_24 = 0xff;
            local_23 = 0xff;
            local_22 = 0xff;
            local_21 = 0xff;
            puVar10[-1] = *(int *)(this + 0x1c) + 0x4028;
            puVar10[-2] = 0xa9bf26;
            INextBot::DebugConColorMsg();
            puVar10[3] = (uint)"OnDrop";
            puVar10[2] = (uint)"reponded to EVENT %s with ";
            puVar10[1] = (uint)&local_24;
            *puVar10 = 1;
            local_24 = 0xff;
            local_23 = 0xff;
            local_22 = 0;
            local_21 = 0xff;
            puVar10[-1] = *(int *)(this + 0x1c) + 0x4028;
            puVar10[-2] = 0xa9bf65;
            INextBot::DebugConColorMsg();
            puVar6 = &DAT_00d539c2;
            if (local_30 != (int *)0x0) {
              iVar2 = *local_30;
              puVar10[-1] = (uint)local_30;
              pcVar3 = *(code **)(iVar2 + 0xa4);
              puVar10[-2] = 0xa9bf7c;
              puVar6 = (undefined1 *)(*pcVar3)();
            }
            pcVar8 = "CONTINUE";
            if (local_34 - 1U < 4) {
              pcVar8 = *(char **)(CSWTCH_3265 + (local_34 - 1U) * 4);
            }
            puVar10[4] = (uint)puVar6;
            puVar10[3] = (uint)pcVar8;
            puVar10[2] = (uint)"%s %s ";
            puVar10[1] = (uint)&local_24;
            *puVar10 = 1;
            local_24 = 0xff;
            local_23 = 0;
            local_22 = 0;
            local_21 = 0xff;
            puVar10[-1] = *(int *)(this + 0x1c) + 0x4028;
            puVar10[-2] = 0xa9bfd2;
            INextBot::DebugConColorMsg();
            puVar10[2] = (uint)&DAT_00c5799e;
            *puVar10 = 1;
            local_24 = 0;
            local_23 = 0xff;
            puVar6 = &DAT_00d539c2;
            if (local_2c != (undefined1 *)0x0) {
              puVar6 = local_2c;
            }
            local_22 = 0;
            local_21 = 0xff;
            puVar10[3] = (uint)puVar6;
            puVar10[1] = (uint)&local_24;
            puVar10[-1] = *(int *)(this + 0x1c) + 0x4028;
            puVar10[-2] = 0xa9c01a;
            INextBot::DebugConColorMsg();
          }
        }
        puVar10[1] = (uint)"OnDrop";
        *puVar10 = (uint)&local_34;
        puVar10[-1] = (uint)pAVar9;
        puVar10[-2] = 0xa9c031;
        StorePendingEventResult
                  ((Action<Hunter> *)puVar10[-1],(EventDesiredResult *)*puVar10,(char *)puVar10[1]);
        break;
      }
      pAVar9 = *(Action<Hunter> **)(pAVar9 + 0x14);
      puVar11 = puVar10 + -1;
    } while (pAVar9 != (Action<Hunter> *)0x0);
    iVar2 = *(int *)this;
    puVar10[-1] = (uint)this;
    pcVar3 = *(code **)(iVar2 + 8);
    puVar10[-2] = 0xa9c039;
    piVar7 = (int *)(*pcVar3)();
    while (puVar11 = puVar10 + -1, piVar7 != (int *)0x0) {
      iVar2 = *piVar7;
      puVar10[-1] = (uint)piVar7;
      *puVar10 = (uint)param_1;
      pcVar3 = *(code **)(iVar2 + 0x70);
      puVar10[-2] = 0xa9c064;
      (*pcVar3)();
      iVar2 = *(int *)this;
      *puVar10 = (uint)piVar7;
      puVar10[-1] = (uint)this;
      pcVar3 = *(code **)(iVar2 + 0xc);
      puVar10[-2] = 0xa9c070;
      piVar7 = (int *)(*pcVar3)();
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  puVar11[-1] = (uint)&UNK_00a9c07d;
  __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)