L L4D2node

ZombieBotBody::AimHeadTowards

0x00a4cc40 · 839 bytes · __cdecl

_ZN13ZombieBotBody14AimHeadTowardsERK6VectorN5IBody18LookAtPriorityTypeEfP13INextBotReplyPKc

Decompiled

undefined (5 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ZombieBotBody::AimHeadTowards(Vector const&, IBody::LookAtPriorityType, float, INextBotReply*,
   char const*) */

void ZombieBotBody::AimHeadTowards
               (int *param_1,float *param_2,undefined4 param_3,undefined4 param_4,
               undefined4 *param_5)

{
  uint *puVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  CBaseAnimating *pCVar6;
  int iVar7;
  code *pcVar8;
  char cVar9;
  float *pfVar10;
  CStudioHdr *pCVar11;
  undefined4 uVar12;
  int iVar13;
  CStudioHdr *pCVar14;
  longdouble lVar15;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  float local_28;
  float local_24;
  
  local_3c = 0;
  local_38 = 0;
  if (_towlower == 0) {
    local_2c = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_3c,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/zombiebotbody.cpp",199,
               &AimHeadTowards(Vector_const&,IBody::LookAtPriorityType,float,INextBotReply*,char_const*)
                ::tm_fmt,"(%s)%s","NextBot","ZombieBotBody::AimHeadTowards( pos )");
    local_2c = _towlower;
  }
  iVar7 = _DAT_0105db00;
  local_34 = local_3c;
  local_30 = local_38;
                    /* try { // try from 00a4cec6 to 00a4cf26 has its CatchHandler @ 00a4cfc2 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar13 = ThreadGetCurrentId(), iVar7 == iVar13)) {
    if ((char *)*_DAT_0105d15c != "ZombieBotBody::AimHeadTowards( pos )") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd27fc8,(char *)0x0,0xca8906);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00a4ccfc to 00a4ce2e has its CatchHandler @ 00a4cfa1 */
  pfVar10 = (float *)(**(code **)(*param_1 + 0xb8))(param_1);
  fVar2 = param_2[2];
  fVar3 = *param_2;
  fVar4 = pfVar10[2];
  fVar5 = *pfVar10;
  param_1[0xb] = (int)(param_2[1] - pfVar10[1]);
  param_1[0xc] = (int)(fVar2 - fVar4);
  param_1[10] = (int)(fVar3 - fVar5);
  VectorNormalize((Vector *)(param_1 + 10));
  VectorAngles((Vector *)(param_1 + 10),(QAngle *)&local_28);
  fVar2 = *(float *)(param_1[5] + 0x3a8);
  lVar15 = (longdouble)AngleDiff(local_24,*(float *)(param_1[5] + 0x3ac));
  pCVar6 = (CBaseAnimating *)param_1[5];
  iVar7 = param_1[0x1c];
  pCVar11 = *(CStudioHdr **)(pCVar6 + 0x13e0);
  if (pCVar11 == (CStudioHdr *)0x0) {
    iVar13 = CBaseEntity::GetModel((CBaseEntity *)pCVar6);
    if (iVar13 != 0) {
      CBaseAnimating::LockStudioHdr(pCVar6);
    }
    pCVar11 = *(CStudioHdr **)(pCVar6 + 0x13e0);
    pCVar14 = (CStudioHdr *)0x0;
    if (pCVar11 != (CStudioHdr *)0x0) goto LAB_00a4cd8d;
  }
  else {
LAB_00a4cd8d:
    pCVar14 = (CStudioHdr *)0x0;
    if (*(int *)pCVar11 != 0) {
      pCVar14 = pCVar11;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar6,pCVar14,iVar7,(float)lVar15);
  lVar15 = (longdouble)AngleDiff(local_28,fVar2);
  pCVar6 = (CBaseAnimating *)param_1[5];
  iVar7 = param_1[0x1d];
  pCVar11 = *(CStudioHdr **)(pCVar6 + 0x13e0);
  if (pCVar11 == (CStudioHdr *)0x0) {
                    /* try { // try from 00a4cf4b to 00a4cf8b has its CatchHandler @ 00a4cfa1 */
    iVar13 = CBaseEntity::GetModel((CBaseEntity *)pCVar6);
    if (iVar13 != 0) {
      CBaseAnimating::LockStudioHdr(pCVar6);
    }
    pCVar11 = *(CStudioHdr **)(pCVar6 + 0x13e0);
    pCVar14 = (CStudioHdr *)0x0;
    if (pCVar11 == (CStudioHdr *)0x0) goto LAB_00a4cded;
  }
  pCVar14 = (CStudioHdr *)0x0;
  if (*(int *)pCVar11 != 0) {
    pCVar14 = pCVar11;
  }
LAB_00a4cded:
  CBaseAnimating::SetPoseParameter(pCVar6,pCVar14,iVar7,(float)lVar15);
  if (param_5 != (undefined4 *)0x0) {
    pcVar8 = *(code **)*param_5;
    uVar12 = (**(code **)(*param_1 + 0xb0))(param_1);
    (*pcVar8)(param_5,uVar12);
  }
  iVar7 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar13 = ThreadGetCurrentId(), iVar7 == iVar13)) {
    cVar9 = CVProfNode::ExitScope();
    if (cVar9 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_2c != 0) {
    (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
  }
  return;
}

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)