L L4D2node

CBaseCombatWeapon::WeaponLOSCondition

0x005fe410 · 1283 bytes · __thiscall

_ZN17CBaseCombatWeapon18WeaponLOSConditionERK6VectorS2_b

Decompiled

undefined (4 params)

/* WARNING: Type propagation algorithm not settling */
/* CBaseCombatWeapon::WeaponLOSCondition(Vector const&, Vector const&, bool) */

bool __thiscall
CBaseCombatWeapon::WeaponLOSCondition
          (CBaseCombatWeapon *this,Vector *param_1,Vector *param_2,bool param_3)

{
  uint uVar1;
  IHandleEntity *pIVar2;
  char cVar3;
  CBaseEntity *this_00;
  IHandleEntity *pIVar4;
  int *piVar5;
  undefined4 *puVar6;
  int iVar7;
  undefined *puVar8;
  int *local_104;
  float local_f0;
  float local_ec;
  float local_e8;
  undefined **local_e4 [5];
  undefined4 local_d0;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  float local_70;
  float local_6c;
  float local_68;
  Vector local_64 [32];
  float local_44;
  int *local_24;
  
  this_00 = (CBaseEntity *)CBaseEntity::MyNPCPointer();
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  (**(code **)(*(int *)this_00 + 0x478))((Vector *)&local_70,this_00);
  local_f0 = (local_70 + *(float *)param_1) - *(float *)(this_00 + 0x2e0);
  local_ec = (local_6c + *(float *)(param_1 + 4)) - *(float *)(this_00 + 0x2e4);
  local_e8 = (local_68 + *(float *)(param_1 + 8)) - *(float *)(this_00 + 0x2e8);
  pIVar4 = (IHandleEntity *)(**(code **)(*(int *)this_00 + 0x1a4))(this_00);
  uVar1 = *(uint *)(this + 0x13f4);
  if (((uVar1 == 0xffffffff) ||
      (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) {
    CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities
              ((CTraceFilterSkipTwoEntities *)local_e4,(IHandleEntity *)0x0,pIVar4,6);
    local_e4[0] = &PTR_ShouldHitEntity_00c5bf88;
    local_d0 = 0;
  }
  else {
    pIVar2 = *(IHandleEntity **)(puVar8 + 4);
    CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities
              ((CTraceFilterSkipTwoEntities *)local_e4,pIVar2,pIVar4,6);
    local_e4[0] = &PTR_ShouldHitEntity_00c5bf88;
    local_d0 = 0;
    if ((pIVar2 != (IHandleEntity *)0x0) &&
       (piVar5 = (int *)(**(code **)(*(int *)pIVar2 + 0x144))(pIVar2), piVar5 != (int *)0x0)) {
      local_d0 = (**(code **)(*piVar5 + 0x504))(piVar5);
    }
  }
  local_88 = 1;
  local_8c = 0;
  local_cc = local_f0;
  local_c8 = local_ec;
  local_c4 = local_e8;
  local_bc = *(float *)param_2 - local_f0;
  local_b8 = *(float *)(param_2 + 4) - local_ec;
  local_b4 = *(float *)(param_2 + 8) - local_e8;
  local_94 = 0;
  local_98 = 0;
  local_9c = 0;
  local_87 = local_bc * local_bc + local_b8 * local_b8 + local_b4 * local_b4 != 0.0;
  local_a4 = 0;
  local_a8 = 0;
  local_ac = 0;
  (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x46004003,local_e4,(Vector *)&local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine((Vector *)&local_70,local_64,0xff,0,0,true,-1.0);
  }
  if (local_44 != 1.0) {
    piVar5 = (int *)(**(code **)(*(int *)this_00 + 0x1a4))(this_00);
    if (((piVar5 != (int *)0x0) && (cVar3 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar3 != '\0'))
       && (cVar3 = (**(code **)(*piVar5 + 0x4fc))(piVar5), cVar3 != '\0')) {
      piVar5 = (int *)(**(code **)(*piVar5 + 0x500))(piVar5);
      piVar5 = (int *)(**(code **)(*piVar5 + 0x20))(piVar5);
      if (local_24 == piVar5) {
        return true;
      }
      local_104 = (int *)0x0;
      uVar1 = local_24[0x88];
      if (((uVar1 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
        local_104 = *(int **)(puVar8 + 4);
      }
      if (piVar5 == local_104) {
        return true;
      }
    }
    piVar5 = (int *)(**(code **)(*(int *)this_00 + 0x1a4))(this_00);
    if (local_24 != piVar5) {
      puVar6 = (undefined4 *)(**(code **)(*local_24 + 0x18c))(local_24);
      if (puVar6 == (undefined4 *)0x0) {
        iVar7 = (**(code **)(*local_24 + 0x144))(local_24);
      }
      else {
        iVar7 = (**(code **)*puVar6)(puVar6,0);
      }
      if (iVar7 != 0) {
        iVar7 = (**(code **)(*(int *)this_00 + 0x4f4))(this_00,iVar7);
        return iVar7 == 1;
      }
      if (!param_3) {
        return false;
      }
      if (*(int *)(ai_debug_shoot_positions._28_4_ + 0x30) != 0) {
        NDebugOverlay::Line((Vector *)&local_70,local_64,0xff,0,0,false,1.0);
        return false;
      }
      return false;
    }
  }
  if (*(int *)(ai_debug_shoot_positions._28_4_ + 0x30) != 0) {
    NDebugOverlay::Line((Vector *)&local_f0,param_2,0,0xff,0,false,1.0);
  }
  return true;
}

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)