Server: Use the undocumented (but handy) readcmd instead of localcmd to parse skill files instantly. This will avoid the bug of delayed config loading. That's the theory.

This commit is contained in:
Marco Cawthorne 2020-07-25 01:58:12 +02:00
parent 9d58f78548
commit da7c5a27e2
3 changed files with 12 additions and 4 deletions

View File

@ -252,10 +252,7 @@ void worldspawn(void)
lightstyle(9, "aaaaaaaazzzzzzzz");
lightstyle(10, "mmamammmmammamamaaamammma");
lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
/* sometimes we have extra overrides that the original does not
provide. so we execute our mod-specific config here */
localcmd(sprintf("exec skill_%s.cfg\n", cvar_string("game")));
Skill_Init();
}
float ConsoleCmd(string cmd)

View File

@ -14,6 +14,16 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
string(string cmd) readcmd = #0;
void
Skill_Init(void)
{
/* sometimes we have extra overrides that the original does not
provide. so we execute our mod-specific config here */
readcmd(sprintf("exec skill_%s.cfg\n", cvar_string("game")));
}
float Skill_GetValue(string variable)
{
float skill = cvar("skill");

View File

@ -15,4 +15,5 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void Skill_Init(void);
float Skill_GetValue(string);