L L4D2node

CBaseCombatCharacter::ComputeTargetIsInDarkness

0x003fec70 · 653 bytes · __thiscall

_ZNK20CBaseCombatCharacter25ComputeTargetIsInDarknessERK6VectorP8CNavAreaS2_

Decompiled

undefined (4 params)

/* CBaseCombatCharacter::ComputeTargetIsInDarkness(Vector const&, CNavArea*, Vector const&) const */

undefined4 __thiscall
CBaseCombatCharacter::ComputeTargetIsInDarkness
          (CBaseCombatCharacter *this,Vector *param_1,CNavArea *param_2,Vector *param_3)

{
  int iVar1;
  undefined4 uVar2;
  CNavArea *this_00;
  longdouble lVar3;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined **local_dc [4];
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 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;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  byte local_2e;
  
  iVar1 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  uVar2 = IsASurvivorTeam(iVar1);
  if ((char)uVar2 != '\0') {
    if ((param_2 != (CNavArea *)0x0) &&
       (lVar3 = (longdouble)CNavArea::GetAverageLightIntensity(param_2), (float)lVar3 < 0.1)) {
      CTraceFilterSimple::CTraceFilterSimple
                ((CTraceFilterSimple *)local_dc,(IHandleEntity *)this,0,
                 (_func_bool_IHandleEntity_ptr_int *)0x0);
      local_dc[0] = &PTR_ShouldHitEntity_00c54558;
      local_e8 = *(float *)param_3 - *(float *)param_1;
      local_e4 = *(float *)(param_3 + 4) - *(float *)(param_1 + 4);
      local_e0 = *(float *)(param_3 + 8) - *(float *)(param_1 + 8);
      VectorNormalize((Vector *)&local_e8);
      local_8c = 0;
      local_88 = 1;
      local_bc = local_e8 * 32768.0;
      local_b8 = local_e4 * 32768.0;
      local_cc = *(undefined4 *)param_3;
      local_b4 = local_e0 * 32768.0;
      local_c8 = *(undefined4 *)(param_3 + 4);
      local_c4 = *(undefined4 *)(param_3 + 8);
      local_94 = 0;
      local_98 = 0;
      local_9c = 0;
      local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
      local_a4 = 0;
      local_a8 = 0;
      local_ac = 0;
      (**(code **)(*enginetrace + 0x14))
                (enginetrace,&local_cc,0x2006041,(CTraceFilterSimple *)local_dc,local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
      }
      if ((((local_44 < 1.0) && ((local_2e & 4) == 0)) &&
          (this_00 = (CNavArea *)
                     CNavMesh::GetNearestNavArea(TheNavMesh,local_64,false,100.0,false,true,false),
          this_00 != (CNavArea *)0x0)) &&
         (lVar3 = (longdouble)CNavArea::GetAverageLightIntensity(this_00), (float)lVar3 < 0.1)) {
        return uVar2;
      }
    }
    uVar2 = 0;
  }
  return uVar2;
}

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)