CTerrorPlayer::Precache
0x009d17d0 · 2396 bytes · __thiscall
_ZN13CTerrorPlayer8PrecacheEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorPlayer::Precache() */
void __thiscall CTerrorPlayer::Precache(CTerrorPlayer *this)
{
uint *puVar1;
void *pvVar2;
char cVar3;
KeyValues *pKVar4;
int iVar5;
int iVar6;
int *piVar7;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_towlower == 0) {
local_20 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_34,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",0x608,
&Precache()::tm_fmt,"(%s)%s","ZOMBIE","CTerrorPlayer::Precache");
local_20 = _towlower;
}
iVar6 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 009d1f8b to 009d1feb has its CatchHandler @ 009d214d */
if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
(iVar5 = ThreadGetCurrentId(), iVar6 != iVar5)) {
if (*(int *)(this + 0xfc) != 0) {
LAB_009d2006:
/* try { // try from 009d2009 to 009d200d has its CatchHandler @ 009d212c */
CCSPlayer::Precache((CCSPlayer *)this);
iVar6 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar5 = ThreadGetCurrentId(), iVar6 == iVar5)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 == 0) {
return;
}
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
return;
}
piVar7 = &DAT_0101736c;
}
else {
if ((char *)*_DAT_0105d15c != "CTerrorPlayer::Precache") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd157a1,(char *)0x0,0xc0db47);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
piVar7 = &DAT_0101736c;
if (*(int *)(this + 0xfc) != 0) goto LAB_009d2006;
}
do {
if (0 < *piVar7) {
iVar6 = 0;
do {
pvVar2 = *(void **)(piVar7[-3] + iVar6 * 4);
if (pvVar2 != (void *)0x0) {
operator_delete__(pvVar2);
}
iVar6 = iVar6 + 1;
} while (iVar6 < *piVar7);
}
*piVar7 = 0;
piVar7 = piVar7 + 5;
} while (piVar7 != (int *)&DAT_01017420);
/* try { // try from 009d18dd to 009d1f23 has its CatchHandler @ 009d212c */
PrecacheSurvivorModels(this);
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer.mdl");
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer_head.mdl");
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer_rarm.mdl");
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer_steak1.mdl");
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer_steak2.mdl");
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomer_steak3.mdl");
pKVar4 = (KeyValues *)CTerrorGameRules::GetMissionInfo();
if ((pKVar4 != (KeyValues *)0x0) &&
(iVar6 = KeyValues::GetInt(pKVar4,"no_female_boomers",0), iVar6 == 0)) {
/* try { // try from 009d209f to 009d20ec has its CatchHandler @ 009d212c */
CBaseEntity::PrecacheModel("models/infected/limbs/exploded_boomette.mdl");
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/boomette.mdl","BoometteVariant",
(CUtlVector *)&DAT_01017388);
}
CBaseEntity::PrecacheModel("models/infected/smoker_tongue_attach.mdl");
CBaseEntity::PrecacheModel("models/w_models/weapons/w_eq_defibrillator_no_paddles.mdl");
cVar3 = (**(code **)(*engine + 500))(engine);
if ((cVar3 != '\0') || (cVar3 = (**(code **)(*engine + 0x1f8))(engine), cVar3 != '\0')) {
pKVar4 = (KeyValues *)CTerrorGameRules::GetMissionInfo();
iVar6 = KeyValues::GetInt(pKVar4,"allow_diesel",0);
if (iVar6 == 0) goto LAB_009d19a8;
}
CBaseEntity::PrecacheModel("models/props_junk/dieselcan.mdl");
LAB_009d19a8:
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/hunter.mdl","HunterVariant",
(CUtlVector *)&DAT_0101739c);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/smoker.mdl","SmokerVariant",
(CUtlVector *)&DAT_01017374);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/boomer.mdl","BoomerVariant",
(CUtlVector *)&DAT_01017388);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/spitter.mdl","SpitterVariant",
(CUtlVector *)&DAT_010173b0);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/jockey.mdl","JockeyVariant",
(CUtlVector *)&DAT_010173c4);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/charger.mdl","ChargerVariant",
(CUtlVector *)&DAT_010173d8);
PrecachePlayerModelAndMaterials
((CBaseAnimating *)this,"models/infected/hulk.mdl","TankVariant",
(CUtlVector *)&DAT_01017400);
PrecacheMaterial("particle/particle_smokegrenade");
CCSPlayer::Precache((CCSPlayer *)this);
CBaseEntity::PrecacheScriptSound("Player.JumpLand");
CBaseEntity::PrecacheScriptSound("PlayerZombie.JumpLand");
CBaseEntity::PrecacheScriptSound("Player.HitInternal");
CBaseEntity::PrecacheScriptSound("Player.Heartbeat");
CBaseEntity::PrecacheScriptSound("Player.Fall");
CBaseEntity::PrecacheScriptSound("Player.BandagingWounds");
CBaseEntity::PrecacheScriptSound("Player.AwardUpgrade");
CBaseEntity::PrecacheScriptSound("Player.NeckSnap");
CBaseEntity::PrecacheScriptSound("Blood.Splat");
CBaseEntity::PrecacheScriptSound("Vomit.Use");
CBaseEntity::PrecacheScriptSound("Player.UsingGasCan");
CBaseEntity::PrecacheScriptSound("Player.UsingGasCanStop");
CBaseEntity::PrecacheScriptSound("SmokerZombie.Pain");
CBaseEntity::PrecacheScriptSound("SmokerZombie.PainShort");
CBaseEntity::PrecacheScriptSound("SmokerZombie.Alert");
CBaseEntity::PrecacheScriptSound("SmokerZombie.Warn");
CBaseEntity::PrecacheScriptSound("SmokerZombie.TongueAttack");
CBaseEntity::PrecacheScriptSound("SmokerZombie.TongueHit");
CBaseEntity::PrecacheScriptSound("SmokerZombie.TongueRetract");
CBaseEntity::PrecacheScriptSound("SmokerZombie.TongueFly");
CBaseEntity::PrecacheScriptSound("Player.Choke");
CBaseEntity::PrecacheScriptSound("HulkZombie.Thud");
CBaseEntity::PrecacheScriptSound("HulkZombie.Pain");
CBaseEntity::PrecacheScriptSound("HulkZombie.PainFire");
CBaseEntity::PrecacheScriptSound("PlayerZombie.BecomeGhost");
CBaseEntity::PrecacheScriptSound("PlayerZombie.BecomeReal");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Rage");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Breathe");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Attack");
CBaseEntity::PrecacheScriptSound("PlayerZombie.AttackMiss");
CBaseEntity::PrecacheScriptSound("PlayerZombie.AttackHit");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Hurt");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Die");
CBaseEntity::PrecacheScriptSound("PlayerZombie.CullWarn");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Fall");
CBaseEntity::PrecacheScriptSound("PlayerZombie.Thud");
CBaseEntity::PrecacheScriptSound("HunterZombie.LungeLand");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce");
CBaseEntity::PrecacheScriptSound("HunterZombie.Lunge");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce.Cancel");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce.Hit");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce.FlyLoop");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce.Miss");
CBaseEntity::PrecacheScriptSound("HunterZombie.Growl");
CBaseEntity::PrecacheScriptSound("HunterZombie.Warn");
CBaseEntity::PrecacheScriptSound("HunterZombie.Alert");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pounce.shred");
CBaseEntity::PrecacheScriptSound("HunterZombie.Death");
CBaseEntity::PrecacheScriptSound("HunterZombie.Pain");
CBaseEntity::PrecacheScriptSound("HunterZombie.PainShort");
CBaseEntity::PrecacheScriptSound("BoomerZombie.Alert");
CBaseEntity::PrecacheScriptSound("BoomerZombie.Pain");
CBaseEntity::PrecacheScriptSound("BoomerZombie.PainShort");
CBaseEntity::PrecacheScriptSound("JockeyZombie.Ride");
CBaseEntity::PrecacheScriptSound("Hint.Critical");
CBaseEntity::PrecacheScriptSound("Hint.Helpful");
CBaseEntity::PrecacheScriptSound("Hint.LittleReward");
CBaseEntity::PrecacheScriptSound("Hint.BigReward");
CBaseEntity::PrecacheScriptSound("Instructor.LessonStart");
CBaseEntity::PrecacheScriptSound("Instructor.ImportantLessonStart");
CBaseEntity::PrecacheScriptSound("Scavenge.point_scored");
CBaseEntity::PrecacheScriptSound("Scavenge.zero_time");
CBaseEntity::PrecacheScriptSound("ScavengeSB.ZeroScore");
CBaseEntity::PrecacheScriptSound("ScavengeSB.OpenTiePanel");
CBaseEntity::PrecacheScriptSound("ScavengeSB.DisplayChange");
CBaseEntity::PrecacheScriptSound("ScavengeSB.RoundScoreIncrement");
CBaseEntity::PrecacheScriptSound("ScavengeSB.MatchScoreIncrement");
CBaseEntity::PrecacheScriptSound("ScavengeSB.RoundTimeIncrement");
CBaseEntity::PrecacheScriptSound("ScavengeSB.MatchScoreFinal");
CBaseEntity::PrecacheScriptSound("Scavenge.ClusterSpawned");
CBaseEntity::PrecacheScriptSound("Weapon.Swing");
CBaseEntity::PrecacheScriptSound("Weapon.HitSurvivor");
CBaseEntity::PrecacheScriptSound("Weapon.HitWorld");
CBaseEntity::PrecacheScriptSound("Weapon.HitBoomer");
CBaseEntity::PrecacheScriptSound("Weapon.HitInfected");
CBaseEntity::PrecacheScriptSound("Weapon.HitClown");
CBaseEntity::PrecacheScriptSound("Knife.StabHunter");
CBaseEntity::PrecacheScriptSound("Knife.BreakTongue");
CBaseEntity::PrecacheScriptSound("BlindingFlash");
CBaseEntity::PrecacheScriptSound("ChargerZombie.Smash");
CBaseEntity::PrecacheScriptSound("Player.LaserOn");
CBaseEntity::PrecacheScriptSound("Event.NewAvailableZombie");
PrecacheParticleSystem("water_trail_directional");
PrecacheParticleSystem("water_trail_directional_walk");
PrecacheParticleSystem("water_trail_idle");
PrecacheParticleSystem("burning_character");
PrecacheParticleSystem("burning_character_screen");
PrecacheParticleSystem("speech_voice");
PrecacheParticleSystem("water_splash");
PrecacheParticleSystem("cigarette_smoke");
PrecacheParticleSystem("smoker_spore_trail");
PrecacheParticleSystem("smoker_smokecloud");
PrecacheParticleSystem("smoker_smokecloud_camera");
PrecacheParticleSystem("boomer_vomit_screeneffect");
PrecacheParticleSystem("smoker_screen_effect");
PrecacheParticleSystem("spitter_slime_trail");
PrecacheResponseSystem();
iVar6 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar5 = ThreadGetCurrentId(this), iVar6 == iVar5)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.