L L4D2node

z_decals

0x00a0d350 · 985 bytes · __cdecl

_ZL8z_decalsRK8CCommand

Decompiled

undefined (1 param)

/* WARNING: Type propagation algorithm not settling */
/* z_decals(CCommand const&) */

void z_decals(CCommand *param_1)

{
  CBaseEntity *pCVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int in_GS_OFFSET;
  longdouble lVar5;
  CBaseEntity *pCVar6;
  int aiStack_324 [132];
  int local_114;
  int *local_110;
  float local_10c;
  float local_108;
  float local_104;
  int local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  float local_e4;
  float local_e0;
  float local_dc;
  float local_d8;
  float local_d4;
  float 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;
  CGameTrace local_74 [44];
  float local_48;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar6 = (CBaseEntity *)0x0;
  while (pCVar6 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar6),
        pCVar6 != (CBaseEntity *)0x0) {
    pCVar1 = (CBaseEntity *)__dynamic_cast(pCVar6,&CBaseEntity::typeinfo,&Infected::typeinfo,0);
    if (pCVar1 != (CBaseEntity *)0x0) {
      iVar3 = 0;
      do {
        iVar4 = iVar3;
        iVar3 = iVar4 + 1;
        aiStack_324[iVar3] = (int)pCVar1;
        pCVar6 = pCVar1;
        do {
          pCVar6 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar6);
          local_100 = iVar4;
          if (pCVar6 == (CBaseEntity *)0x0) goto LAB_00a0d3e0;
          pCVar1 = (CBaseEntity *)
                   __dynamic_cast(pCVar6,&CBaseEntity::typeinfo,&Infected::typeinfo,0);
        } while (pCVar1 == (CBaseEntity *)0x0);
      } while( true );
    }
  }
  iVar3 = 0;
  Msg("No infected to decal.\n");
  local_100 = -1;
LAB_00a0d3e0:
  iVar4 = 0;
  local_114 = iVar3;
  local_110 = aiStack_324 + 1;
  do {
    while( true ) {
      iVar3 = RandomInt(0,local_100);
      iVar3 = local_110[iVar3];
      if (iVar3 != 0) break;
LAB_00a0d685:
      iVar4 = iVar4 + 1;
      if (0x18 < iVar4) goto LAB_00a0d68a;
    }
    CCollisionProperty::CollisionAABBToWorldAABB
              ((CCollisionProperty *)(iVar3 + 0x194),(Vector *)(iVar3 + 0x19c),
               (Vector *)(iVar3 + 0x1a8),(Vector *)&local_fc,(Vector *)&local_f0);
    lVar5 = (longdouble)RandomFloat(local_fc,local_f0);
    local_104 = (float)lVar5;
    lVar5 = (longdouble)RandomFloat(local_f8,local_ec);
    local_108 = (float)lVar5;
    lVar5 = (longdouble)RandomFloat(local_f4,local_e8);
    local_10c = (float)lVar5;
    iVar2 = rand();
    local_e4 = (float)iVar2 * 0.0054933317 - 90.0;
    iVar2 = rand();
    local_e0 = (float)iVar2 * 0.0054933317 - 90.0;
    iVar2 = rand();
    local_dc = (float)iVar2 * 0.0054933317 - 90.0;
    AngleVectors((QAngle *)&local_e4,(Vector *)&local_d8);
    local_94 = 0;
    local_98 = 0;
    local_9c = 0;
    local_a4 = 0;
    local_bc = local_d8 * 600.0;
    local_a8 = 0;
    local_b8 = local_d4 * 600.0;
    local_ac = 0;
    local_b4 = local_d0 * 600.0;
    local_88 = 1;
    local_8c = 0;
    local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
    local_cc = local_d8 * -300.0 + local_104;
    local_104 = local_10c;
    local_c8 = local_108 + local_d4 * -300.0;
    local_c4 = local_10c + local_d0 * -300.0;
    (**(code **)(*enginetrace + 0x10))
              (enginetrace,&local_cc,0xffffffff,(CCollisionProperty *)(iVar3 + 0x194),local_74);
    if (local_48 != 1.0) {
      UTIL_ImpactTrace(local_74,0x40,(char *)0x0);
      goto LAB_00a0d685;
    }
  } while (iVar4 < 0x19);
LAB_00a0d68a:
  Msg("%d decals painted on %d zombies.\n",iVar4,local_114);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)