jlyne1234
10-30-2014, 09:26
Hi,
I'm working on a plugin that randomly replaces standard spell pickups with rare pickups.
It's working fine, however if I change the map to plr_hightower_event (the 2013 map that had spells on it) the server crashes with a not precached error:
L 10/30/2014 - 12:57:22: Engine error: 722/spell_pickup_common - tf_spell_pickup: UTIL_SetModel: not precached: models/props_halloween/hwn_spellbook_upright_major.mdl
This doesn't really make sense as I am precaching the models in both OnPluginStart and OnMapStart (that latter being an attempt to fix it):
public OnPluginStart() {
g_Cvar_Enabled = CreateConVar("rare_spells_enabled", "1", "Enable rare spell drops", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_Cvar_Chance = CreateConVar("rare_spell_rate", "0.1", "Drop rate of rare spells", FCVAR_NOTIFY, true, 0.0, true, 1.0);
PrecacheModel("models/props_halloween/hwn_spellbook_upright_major.mdl");
PrecacheModel("models/props_halloween/hwn_spellbook_upright.mdl");
CreateTimer(0.1, CheckSpellbooks, INVALID_HANDLE, TIMER_REPEAT);
}
//Cache stuff
public OnMapStart() {
PrecacheModel("models/props_halloween/hwn_spellbook_upright_major.mdl");
PrecacheModel("models/props_halloween/hwn_spellbook_upright.mdl");
}
Weirdly this only happens when changing the map to plr_hightower_event. If i start the server on that map it works fine, which creates the interesting situation where i can change to the same map again and get the above error.
Any help would be appreciated.
Thanks
I'm working on a plugin that randomly replaces standard spell pickups with rare pickups.
It's working fine, however if I change the map to plr_hightower_event (the 2013 map that had spells on it) the server crashes with a not precached error:
L 10/30/2014 - 12:57:22: Engine error: 722/spell_pickup_common - tf_spell_pickup: UTIL_SetModel: not precached: models/props_halloween/hwn_spellbook_upright_major.mdl
This doesn't really make sense as I am precaching the models in both OnPluginStart and OnMapStart (that latter being an attempt to fix it):
public OnPluginStart() {
g_Cvar_Enabled = CreateConVar("rare_spells_enabled", "1", "Enable rare spell drops", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_Cvar_Chance = CreateConVar("rare_spell_rate", "0.1", "Drop rate of rare spells", FCVAR_NOTIFY, true, 0.0, true, 1.0);
PrecacheModel("models/props_halloween/hwn_spellbook_upright_major.mdl");
PrecacheModel("models/props_halloween/hwn_spellbook_upright.mdl");
CreateTimer(0.1, CheckSpellbooks, INVALID_HANDLE, TIMER_REPEAT);
}
//Cache stuff
public OnMapStart() {
PrecacheModel("models/props_halloween/hwn_spellbook_upright_major.mdl");
PrecacheModel("models/props_halloween/hwn_spellbook_upright.mdl");
}
Weirdly this only happens when changing the map to plr_hightower_event. If i start the server on that map it works fine, which creates the interesting situation where i can change to the same map again and get the above error.
Any help would be appreciated.
Thanks