L L4D2node

SurvivorIntention::IsHunterImmediatelyDangerousTo

0x0094bb10 · 651 bytes · __thiscall

_ZNK17SurvivorIntention30IsHunterImmediatelyDangerousToEPK13CTerrorPlayerP20CBaseCombatCharacter

Decompiled

undefined (3 params)

/* SurvivorIntention::IsHunterImmediatelyDangerousTo(CTerrorPlayer const*, CBaseCombatCharacter*)
   const */

uint __thiscall
SurvivorIntention::IsHunterImmediatelyDangerousTo
          (SurvivorIntention *this,CTerrorPlayer *param_1,CBaseCombatCharacter *param_2)

{
  float fVar1;
  CBaseCombatCharacter CVar2;
  char cVar3;
  undefined *puVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  if (((param_2 != (CBaseCombatCharacter *)0x0) &&
      (cVar3 = (**(code **)(*(int *)param_2 + 0x16c))(param_2), cVar3 != '\0')) &&
     (cVar3 = (**(code **)(*(int *)param_2 + 300))(param_2), cVar3 != '\0')) {
    uVar5 = *(uint *)(param_2 + 0x3e64);
    if (((uVar5 != 0xffffffff) &&
        (puVar4 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar4 + 8) == uVar5 >> 0xc && (*(int *)(puVar4 + 4) != 0)))) {
      iVar7 = *(int *)(*(int *)(puVar4 + 4) + 0x30);
      if (iVar7 == 0) {
        iVar7 = 0;
      }
      else {
        iVar7 = iVar7 - *(int *)(gpGlobals + 0x58) >> 4;
      }
      if (*(int *)(param_1 + 0x30) == 0) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      return CONCAT31((int3)((uint)iVar6 >> 8),iVar7 == iVar6);
    }
    CVar2 = param_2[0x3e78];
    if (CVar2 != (CBaseCombatCharacter)0x0) {
      if (((byte)param_2[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
      }
      if (((byte)param_1[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
      }
      local_24 = *(float *)(param_1 + 0x2e0) - *(float *)(param_2 + 0x2e0);
      local_20 = *(float *)(param_1 + 0x2e4) - *(float *)(param_2 + 0x2e4);
      local_1c = *(float *)(param_1 + 0x2e8) - *(float *)(param_2 + 0x2e8);
      VectorNormalize((Vector *)&local_24);
      if (((byte)param_2[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_2);
      }
      local_18 = *(float *)(param_2 + 0x274);
      local_14 = *(float *)(param_2 + 0x278);
      local_10 = *(float *)(param_2 + 0x27c);
      VectorNormalize((Vector *)&local_18);
      if (0.8 < local_14 * local_20 + local_18 * local_24 + local_10 * local_1c) {
        return (uint)(byte)CVar2;
      }
    }
    fVar1 = *(float *)(SurvivorBotThreatMediumRange._28_4_ + 0x2c);
    if (((byte)param_2[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    if ((*(float *)(param_1 + 0x2e0) - *(float *)(param_2 + 0x2e0)) *
        (*(float *)(param_1 + 0x2e0) - *(float *)(param_2 + 0x2e0)) +
        (*(float *)(param_1 + 0x2e4) - *(float *)(param_2 + 0x2e4)) *
        (*(float *)(param_1 + 0x2e4) - *(float *)(param_2 + 0x2e4)) +
        (*(float *)(param_1 + 0x2e8) - *(float *)(param_2 + 0x2e8)) *
        (*(float *)(param_1 + 0x2e8) - *(float *)(param_2 + 0x2e8)) < fVar1 * fVar1) {
      uVar5 = (**(code **)(*(int *)param_1 + 0x42c))(param_1,param_2,1);
      return uVar5;
    }
  }
  return 0;
}

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)