L L4D2node

CEnvEntityMaker::HasRoomToSpawn

0x00690110 · 882 bytes · __thiscall

_ZN15CEnvEntityMaker14HasRoomToSpawnEv

Decompiled

undefined (1 param)

/* CEnvEntityMaker::HasRoomToSpawn() */

undefined4 __thiscall CEnvEntityMaker::HasRoomToSpawn(CEnvEntityMaker *this)

{
  CEnvEntityMaker CVar1;
  uint uVar2;
  CBaseEntity *pCVar3;
  uint *puVar4;
  undefined *puVar5;
  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;
  int *local_24;
  
  uVar2 = *(uint *)(this + 0x45c);
  if ((((uVar2 != 0xffffffff) &&
       (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) &&
     (pCVar3 = *(CBaseEntity **)(puVar5 + 4), pCVar3 != (CBaseEntity *)0x0)) {
    if (((byte)pCVar3[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar3);
    }
    if ((*(float *)(pCVar3 + 0x2e0) == *(float *)(this + 0x460)) &&
       (*(float *)(pCVar3 + 0x2e4) == *(float *)(this + 0x464))) {
      if (*(float *)(pCVar3 + 0x2e8) == *(float *)(this + 0x468)) {
        return 0;
      }
      CVar1 = this[0x14d];
      goto joined_r0x00690157;
    }
  }
  CVar1 = this[0x14d];
joined_r0x00690157:
  if ((((byte)CVar1 & 8) != 0) &&
     (CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this), ((byte)this[0x14d] & 8) != 0)) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_bc = 0;
  local_87 = 0;
  local_b8 = 0;
  local_b4 = 0;
  local_8c = 0;
  local_9c = (*(float *)(this + 0x44c) - *(float *)(this + 0x440)) * 0.5;
  local_94 = (*(float *)(this + 0x454) - *(float *)(this + 0x448)) * 0.5;
  local_98 = (*(float *)(this + 0x450) - *(float *)(this + 0x444)) * 0.5;
  local_ac = (*(float *)(this + 0x44c) + *(float *)(this + 0x440)) * 0.5;
  local_a4 = (*(float *)(this + 0x454) + *(float *)(this + 0x448)) * 0.5;
  local_a8 = (*(float *)(this + 0x450) + *(float *)(this + 0x444)) * 0.5;
  local_c4 = *(float *)(this + 0x2e8) + local_a4;
  local_cc = *(float *)(this + 0x2e0) + local_ac;
  local_ac = -local_ac;
  local_c8 = *(float *)(this + 0x2e4) + local_a8;
  local_a8 = -local_a8;
  local_88 = local_94 * local_94 + local_9c * local_9c + local_98 * local_98 < 1e-06;
  local_a4 = -local_a4;
  CTraceFilterSimple::CTraceFilterSimple
            (local_dc,(IHandleEntity *)this,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_dc,local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
  }
  if (local_24 == (int *)0x0) {
    if (local_39 == '\0') {
      return 1;
    }
    *(undefined4 *)(this + 0x45c) = 0xffffffff;
  }
  else {
    puVar4 = (uint *)(**(code **)(*local_24 + 0xc))(local_24);
    puVar5 = g_pEntityList;
    uVar2 = *puVar4;
    *(uint *)(this + 0x45c) = uVar2;
    if ((((uVar2 != 0xffffffff) &&
         (puVar5 = puVar5 + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) &&
       (pCVar3 = *(CBaseEntity **)(puVar5 + 4), pCVar3 != (CBaseEntity *)0x0)) {
      if (((byte)pCVar3[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar3);
      }
      *(undefined4 *)(this + 0x460) = *(undefined4 *)(pCVar3 + 0x2e0);
      *(undefined4 *)(this + 0x464) = *(undefined4 *)(pCVar3 + 0x2e4);
      *(undefined4 *)(this + 0x468) = *(undefined4 *)(pCVar3 + 0x2e8);
    }
  }
  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)