RuleC: dedicated precache callback which will be called at a specific time.
This commit is contained in:
parent
3e421aab57
commit
e60556e124
2 changed files with 16 additions and 1 deletions
|
@ -436,6 +436,7 @@ initents(void)
|
|||
* let's add our own that we can actually trust. */
|
||||
serverinfo.SetInteger("sv_playerslots", cvars.GetInteger("sv_playerslots"));
|
||||
|
||||
RuleC_Precache();
|
||||
MapC_CallMainFunction();
|
||||
Plugin_InitEnts();
|
||||
Mapcycle_Init();
|
||||
|
|
|
@ -84,13 +84,27 @@ RuleC_Init(void)
|
|||
|
||||
if (mainFunction) {
|
||||
externset(g_ruleCProgs, world, "self");
|
||||
thread(mainFunction())
|
||||
mainFunction();
|
||||
} else {
|
||||
error(sprintf("RuleC %S does not have a main function.", pathToProgs));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RuleC_Precache(void)
|
||||
{
|
||||
void(void) mainFunction;
|
||||
mainFunction = externvalue(g_ruleCProgs, "CodeCallback_Precache");
|
||||
|
||||
if (mainFunction) {
|
||||
externset(g_ruleCProgs, world, "self");
|
||||
mainFunction();
|
||||
} else {
|
||||
NSError("%s does not have a Precache function.", mapname);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MapC_CallMainFunction(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue