L L4D2node

CBaseProp::Precache

0x007fcf40 · 447 bytes · __thiscall

_ZN9CBaseProp8PrecacheEv

Decompiled

undefined (1 param)

/* CBaseProp::Precache() */

void __thiscall CBaseProp::Precache(CBaseProp *this)

{
  CBaseEdict *this_00;
  char *pcVar1;
  undefined1 *puVar2;
  int iVar3;
  int iVar4;
  double dVar5;
  double dVar6;
  char *local_20 [4];
  
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  if (local_20[0] != (char *)0x0) goto LAB_007fcf65;
  if (((byte)this[0x14d] & 8) == 0) {
    dVar6 = (double)*(float *)(this + 0x2e8);
LAB_007fcfc8:
    dVar5 = (double)*(float *)(this + 0x2e4);
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    dVar6 = (double)*(float *)(this + 0x2e8);
    if (((byte)this[0x14d] & 8) == 0) goto LAB_007fcfc8;
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    dVar5 = (double)*(float *)(this + 0x2e4);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
  }
  puVar2 = *(undefined1 **)(this + 0x7c);
  if (puVar2 == (undefined1 *)0x0) {
    puVar2 = &DAT_00d539c2;
  }
  Msg("%s at (%.3f, %.3f, %.3f) has no model name!\n",puVar2,(double)*(float *)(this + 0x2e0),dVar5,
      dVar6);
  AllocPooledString((char *)local_20);
  pcVar1 = local_20[0];
  *(char **)(this + 0x260) = local_20[0];
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  if (pcVar1 == (char *)0x0) {
    pcVar1 = "";
  }
  iVar3 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,pcVar1);
  if (iVar3 != *(int *)(this + 0xf4)) {
    if (this[0x6c] == (CBaseProp)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseProp)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0xf4) = iVar3;
  }
LAB_007fcf65:
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  pcVar1 = "";
  if (local_20[0] != (char *)0x0) {
    pcVar1 = local_20[0];
  }
  CBaseEntity::PrecacheModel(pcVar1);
  CBaseEntity::PrecacheScriptSound("Metal.SawbladeStick");
  CBaseEntity::PrecacheScriptSound("PropaneTank.Burst");
  CBaseAnimating::Precache();
  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)