NSGameRules: add method 'Title' which returns the print name for a given gamerule.

This commit is contained in:
Marco Cawthorne 2023-09-29 16:10:21 -07:00
parent 70bb77d2bb
commit 5c5eedb665
Signed by: eukara
GPG key ID: CE2032F0A2882A22
3 changed files with 12 additions and 1 deletions

View file

@ -116,6 +116,9 @@ public:
/** Called by Nuclide when the server has received a chat message
that is to be distributed amongst all clients of the same team. */
virtual void ChatMessageTeam(NSClient, string);
/** Returns the title of the gamemode running. */
virtual string Title(void);
/* spectator */
/*

View file

@ -533,3 +533,9 @@ NSGameRules::ChatMessageTeam(NSClient cl, string strMessage)
localcmd(sprintf("echo [TEAM] %s: %s\n", cl.netname, strMessage));
}
string
NSGameRules::Title(void)
{
return "Default";
}

View file

@ -403,8 +403,10 @@ initents(void)
Sound_Precache("step_swim.left");
Sound_Precache("step_swim.right");
if (!g_grMode)
if (!g_grMode) {
Game_InitRules();
forceinfokey(world, "mode", g_grMode.Title());
}
Game_Worldspawn();
Decals_Init();