As part of my autoexec.cfg, I have the command "sm plugins refresh." This makes the game freezes up with the error
Quote:
Host_Error: CVEngineServer:PrecacheModel: 'models/w_models/weapons/w_rifle_sg552.mdl' overflow, too many models
|
Tested on two completely fresh installations of L4D2 using different teams' releases. I disabled all other plug-ins but yours, so I believe it's the culprit. The problem must have began somewhere in the 3.0 series of builds. I have been using an earlier release up until now and it didn't have this issue.
I'm not familiar with Left 4 Dead 2's libraries and natives, but I poked through your code and saw that PrecacheHiddenWeaponModels() is called every time the plugin is loaded. Within the function, the native PrecacheModel() routine is called for each Counter Strike weapon. By refreshing plugins in the console, like I'm doing, it attempts to grab a precache a second time and I believe this causes an overflow.
I don't know if either of these are possible, but two solutions that come to mind:
1) Only call the PrecacheHiddenWeaponModels() routine when a game actually starts. (But I doubt you made a call to this function during the initialization unless you really needed to, so maybe this isn't feasible.)
2) Add logic to determine if the caches have been loaded already, and if so, skip the call to the routine during initialization. (No idea if there is such a way.)