L L4D2node

CCSPlayer::Precache

0x0065cb00 · 774 bytes · __thiscall

_ZN9CCSPlayer8PrecacheEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CCSPlayer::Precache() */

void __thiscall CCSPlayer::Precache(CCSPlayer *this)

{
  uint *puVar1;
  int iVar2;
  char cVar3;
  int iVar4;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  local_24 = 0;
  local_20 = 0;
  if (_towlower == 0) {
    local_10 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_24,0,0,0,0,"/data/src/game/server/cstrike/cs_player.cpp",0x2cf,
               &Precache()::tm_fmt,"(%s)%s","ZOMBIE","CCSPlayer::Precache");
    local_10 = _towlower;
  }
  iVar2 = _DAT_0105db00;
  local_18 = local_24;
  local_14 = local_20;
                    /* try { // try from 0065cc2e to 0065cc8e has its CatchHandler @ 0065ce3c */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar4 = ThreadGetCurrentId(), iVar2 != iVar4)) {
    iVar2 = *(int *)(this + 0xfc);
  }
  else {
    if ((char *)*_DAT_0105d15c != "CCSPlayer::Precache") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc6d2d0,(char *)0x0,0xc0db47);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    iVar2 = *(int *)(this + 0xfc);
  }
  if (iVar2 == 0) {
                    /* try { // try from 0065ccab to 0065cd2f has its CatchHandler @ 0065ce1b */
    CBaseEntity::PrecacheScriptSound("Flesh.BulletImpact");
    CBaseEntity::PrecacheScriptSound("Player.PickupWeapon");
    CBaseEntity::PrecacheScriptSound("Player.FlashlightOn");
    CBaseEntity::PrecacheScriptSound("Player.FlashlightOff");
    CBaseEntity::PrecacheScriptSound("Bot.StuckSound");
    CBaseEntity::PrecacheScriptSound("Bot.StuckStart");
    CBaseEntity::PrecacheModel("sprites/glow01.vmt");
    CBaseEntity::PrecacheModel("particle/beam_smoke_01.vmt");
    PrecacheEffect("csblood");
    PrecacheEffect("gunshotsplash");
    PrecacheParticleSystem("achieved");
    CBasePlayer::Precache((CBasePlayer *)this);
    iVar2 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar4 = ThreadGetCurrentId(), iVar2 == iVar4)) {
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_10 != 0) {
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
      return;
    }
  }
  else {
                    /* try { // try from 0065cbc4 to 0065cbd0 has its CatchHandler @ 0065ce1b */
    PrecacheParticleSystem("achieved");
    CBasePlayer::Precache((CBasePlayer *)this);
    iVar2 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar4 = ThreadGetCurrentId(), iVar2 == iVar4)) {
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_10 != 0) {
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
  }
  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)