L L4D2node

Witch::Precache

0x00a47cb0 · 338 bytes · __thiscall

_ZN5Witch8PrecacheEv

Decompiled

undefined (1 param)

/* Witch::Precache() */

void __thiscall Witch::Precache(Witch *this)

{
  void *pvVar1;
  int iVar2;
  
  CBaseCombatCharacter::Precache((CBaseCombatCharacter *)this);
  if (*(int *)(this + 0xfc) != 0) {
    return;
  }
  iVar2 = 0;
  if (0 < DAT_0102651c) {
    do {
      pvVar1 = *(void **)(WitchModels + iVar2 * 4);
      if (pvVar1 != (void *)0x0) {
        operator_delete__(pvVar1);
      }
      iVar2 = iVar2 + 1;
    } while (iVar2 < DAT_0102651c);
  }
  DAT_0102651c = 0;
  PrecachePlayerModelAndMaterials
            ((CBaseAnimating *)this,"models/infected/witch.mdl","WitchVariant",
             (CUtlVector *)&WitchModels);
  PrecacheParticleSystem("witch_eye_glow");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Despair");
  CBaseEntity::PrecacheScriptSound("WanderWitchZombie.Despair");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Scream");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Rage");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Pain");
  CBaseEntity::PrecacheScriptSound("WitchZombie.PainFire");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Surprised");
  CBaseEntity::PrecacheScriptSound("WitchZombie.GrowlLow");
  CBaseEntity::PrecacheScriptSound("WitchZombie.GrowlMedium");
  CBaseEntity::PrecacheScriptSound("WitchZombie.GrowlHigh");
  CBaseEntity::PrecacheScriptSound("WitchZombie.Die");
  CBaseEntity::PrecacheScriptSound("WitchZombie.HeadShot");
  CBaseEntity::PrecacheScriptSound("WitchZombie.ShredVictim");
  CBaseEntity::PrecacheScriptSound("WitchZombie.RetreatHorror");
  CBaseEntity::PrecacheScriptSound("WitchZombie.RageBeforeKillingFrenzy");
  CBaseEntity::PrecacheScriptSound("WitchZombie.KillingFrenzy");
  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)