L L4D2node

ZombieBotBody::StartActivity

0x00a4c750 · 966 bytes · __thiscall

_ZN13ZombieBotBody13StartActivityE8Activityj

Decompiled

undefined (3 params)

/* ZombieBotBody::StartActivity(Activity, unsigned int) */

undefined4 __thiscall ZombieBotBody::StartActivity(ZombieBotBody *this,int param_2,uint param_3)

{
  CBaseEdict *pCVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  int *piVar5;
  int *piVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  INextBot *pIVar9;
  CBaseAnimating *pCVar10;
  int in_GS_OFFSET;
  undefined1 local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar3 = (**(code **)(*(int *)this + 0xe8))(this,4);
  if ((char)uVar3 != '\0') {
    uVar7 = ActivityList_NameForIndex(*(int *)(this + 0x50));
    uVar8 = ActivityList_NameForIndex(param_2);
    local_24 = 0xff;
    local_23 = 0;
    local_22 = 0;
    local_21 = 0xff;
    pIVar9 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
    uVar3 = 0;
    INextBot::DebugConColorMsg
              (pIVar9,8,&local_24,
               "IBody::StartActivity %s failed, current activity %s is ACTIVITY_UNINTERRUPTIBLE\n",
               uVar8,uVar7);
    goto LAB_00a4c886;
  }
  if (*(int *)(this + 0x50) == 0x29a) {
    piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
    piVar6 = (int *)(**(code **)(*piVar6 + 0xc0))(piVar6);
    if (((piVar6 != (int *)0x0) && (cVar2 = (**(code **)(*piVar6 + 0xf8))(piVar6), cVar2 == '\0'))
       && (cVar2 = (**(code **)(*piVar6 + 0x114))(piVar6), cVar2 == '\0')) {
      local_24 = 0xff;
      local_23 = 0;
      local_22 = 0;
      local_21 = 0xff;
      pIVar9 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
      INextBot::DebugConColorMsg
                (pIVar9,8,&local_24,"IBody::StartActivity failed, actor is falling\n");
      goto LAB_00a4c886;
    }
  }
  piVar6 = mdlcache;
  (**(code **)(*mdlcache + 0x68))(mdlcache);
                    /* try { // try from 00a4ca76 to 00a4cb42 has its CatchHandler @ 00a4cb4d */
  if (((param_2 == 0x26e) &&
      (iVar4 = CBaseEntity::GetGender(*(CBaseEntity **)(this + 0x14)), iVar4 == 0xf)) &&
     (iVar4 = RandomInt(1,100), iVar4 < 0x33)) {
    iVar4 = RandomInt(0,1);
    if (iVar4 == 0) {
      iVar4 = CBaseAnimating::LookupSequence
                        (*(CBaseAnimating **)(this + 0x14),"shoved_backward_04g");
      goto LAB_00a4c7be;
    }
    if (iVar4 == 1) {
      iVar4 = CBaseAnimating::LookupSequence
                        (*(CBaseAnimating **)(this + 0x14),"shoved_backward_04j");
      goto LAB_00a4c7be;
    }
    if (*(int *)(this + 0x58) != -1) goto LAB_00a4c7ca;
LAB_00a4cad0:
    local_24 = 0xff;
    local_23 = 0;
    local_22 = 0;
    local_21 = 0xff;
    pIVar9 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
    INextBot::DebugConColorMsg
              (pIVar9,8,&local_24,"IBody::StartActivity failed, activity not available\n");
  }
  else {
                    /* try { // try from 00a4c7b8 to 00a4c82b has its CatchHandler @ 00a4cb4d */
    iVar4 = (**(code **)(*(int *)this + 0xdc))(this,param_2);
LAB_00a4c7be:
    *(int *)(this + 0x58) = iVar4;
    if (iVar4 == -1) goto LAB_00a4cad0;
LAB_00a4c7ca:
    if (*(int *)(this + 0x50) != -1) {
      piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
      (**(code **)(*piVar5 + 0x38))(piVar5,*(undefined4 *)(this + 0x50));
    }
    pCVar10 = *(CBaseAnimating **)(this + 0x14);
    if (*(float *)(pCVar10 + 0x468) != 1.0) {
      if (pCVar10[0x6c] == (CBaseAnimating)0x0) {
        pCVar1 = *(CBaseEdict **)(pCVar10 + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        pCVar10[0x70] = (CBaseAnimating)((byte)pCVar10[0x70] | 1);
      }
      *(undefined4 *)(pCVar10 + 0x468) = 0x3f800000;
      pCVar10 = *(CBaseAnimating **)(this + 0x14);
    }
    CBaseAnimating::SetSequence(pCVar10,*(int *)(this + 0x58));
    pCVar10 = *(CBaseAnimating **)(this + 0x14);
    if (*(float *)(pCVar10 + 0x490) != 0.0) {
      if (pCVar10[0x6c] == (CBaseAnimating)0x0) {
        pCVar1 = *(CBaseEdict **)(pCVar10 + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
                    /* try { // try from 00a4c8ba to 00a4c8fe has its CatchHandler @ 00a4cb4d */
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        pCVar10[0x70] = (CBaseAnimating)((byte)pCVar10[0x70] | 1);
      }
      *(undefined4 *)(pCVar10 + 0x490) = 0;
      pCVar10 = *(CBaseAnimating **)(this + 0x14);
    }
    CBaseAnimating::ResetSequenceInfo(pCVar10);
    *(uint *)(this + 0x54) = param_3;
    *(int *)(this + 0x50) = param_2;
    if ((((param_2 < 0x246) || ((0x24e < param_2 && (param_2 != 0x29a)))) && (4 < param_2 - 0x296U))
       && ((param_3 & 8) == 0)) {
      *(int *)(this + 0x5c) = param_2;
      *(uint *)(this + 0x60) = param_3;
    }
    if ((param_2 - 0x289U < 9) && ((1 << ((byte)(param_2 - 0x289U) & 0x1f) & 0x1efU) != 0)) {
      this[0x48] = (ZombieBotBody)0x1;
      uVar3 = 1;
    }
    else {
      this[0x48] = (ZombieBotBody)0x0;
      uVar3 = 1;
    }
  }
  (**(code **)(*piVar6 + 0x6c))(piVar6);
LAB_00a4c886:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar3;
}

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)