L L4D2node

rescue_show_blocked

0x00968970 · 1261 bytes · __cdecl

_ZL19rescue_show_blockedRK8CCommand

Decompiled

undefined (1 param)

/* rescue_show_blocked(CCommand const&) */

void rescue_show_blocked(CCommand *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  uint uVar4;
  CBaseEntity *this;
  float fVar5;
  double dVar6;
  double dVar7;
  float fVar8;
  float fVar9;
  int local_114;
  float local_f4;
  float local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  CTraceFilterSimple local_dc [16];
  float local_cc;
  float local_c8;
  float local_c4;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_9c;
  float local_98;
  float local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [43];
  char local_39;
  
  this = (CBaseEntity *)0x0;
  local_114 = 0;
  do {
    do {
      this = (CBaseEntity *)
             CGlobalEntityList::FindEntityByClassname
                       ((CGlobalEntityList *)gEntList,this,"info_survivor_rescue");
      if (this == (CBaseEntity *)0x0) {
        return;
      }
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this);
      }
      fVar1 = *(float *)(this + 0x2e0);
      fVar2 = *(float *)(this + 0x2e8);
      fVar3 = *(float *)(this + 0x2e4);
      (**(code **)(*(int *)(this + 0x194) + 0x3c))(this + 0x194,&local_f4,&local_e8);
      if (((byte)this[0x14d] & 8) == 0) {
        fVar5 = *(float *)(this + 0x2e0);
        fVar9 = *(float *)(this + 0x2e4);
        fVar8 = *(float *)(this + 0x2e8);
        local_f4 = local_f4 - fVar5;
        local_f0 = local_f0 - fVar9;
        local_ec = local_ec - fVar8;
      }
      else {
        CBaseEntity::CalcAbsolutePosition(this);
        fVar5 = *(float *)(this + 0x2e0);
        fVar9 = *(float *)(this + 0x2e4);
        fVar8 = *(float *)(this + 0x2e8);
        local_f4 = local_f4 - fVar5;
        local_f0 = local_f0 - fVar9;
        local_ec = local_ec - fVar8;
        if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
          CBaseEntity::CalcAbsolutePosition(this);
          fVar5 = *(float *)(this + 0x2e0);
          fVar9 = *(float *)(this + 0x2e4);
          fVar8 = *(float *)(this + 0x2e8);
        }
      }
      local_87 = 0;
      local_bc = 0;
      local_e8 = local_e8 - fVar5;
      local_b8 = 0;
      local_e4 = local_e4 - fVar9;
      local_b4 = 0;
      local_e0 = local_e0 - fVar8;
      local_ac = (local_e8 + local_f4) * 0.5;
      local_9c = (local_e8 - local_f4) * 0.5;
      local_8c = 0;
      local_98 = (local_e4 - local_f0) * 0.5;
      local_94 = (local_e0 - local_ec) * 0.5;
      local_a4 = (local_e0 + local_ec) * 0.5;
      local_a8 = (local_e4 + local_f0) * 0.5;
      local_cc = fVar1 + local_ac;
      local_ac = -local_ac;
      local_c8 = fVar3 + local_a8;
      local_a8 = -local_a8;
      local_c4 = fVar2 + 1.0 + local_a4;
      local_a4 = -local_a4;
      local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
      CTraceFilterSimple::CTraceFilterSimple
                (local_dc,(IHandleEntity *)0x0,8,(_func_bool_IHandleEntity_ptr_int *)0x0);
      (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x201420b,local_dc,local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
      }
    } while (local_39 == '\0');
    if (((byte)this[0x14d] & 8) == 0) {
      dVar7 = (double)*(float *)(this + 0x2e8);
LAB_00968c93:
      dVar6 = (double)*(float *)(this + 0x2e4);
    }
    else {
      CBaseEntity::CalcAbsolutePosition(this);
      dVar7 = (double)*(float *)(this + 0x2e8);
      if (((byte)this[0x14d] & 8) == 0) goto LAB_00968c93;
      CBaseEntity::CalcAbsolutePosition(this);
      dVar6 = (double)*(float *)(this + 0x2e4);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this);
      }
    }
    local_114 = local_114 + 1;
    Msg("%d: Found a blocked info_survivor_rescue at setpos %f %f %f\n",local_114,
        (double)*(float *)(this + 0x2e0),dVar6,dVar7);
    uVar4 = *(uint *)(this + 0x110);
    if ((uVar4 & 0x29) == 0) {
      *(uint *)(this + 0x110) = uVar4 | 0x29;
    }
    else {
      *(uint *)(this + 0x110) = uVar4 & 0xffffffd6;
    }
  } while( 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)