rules/counterstrike: move precaches into their dedicated callback

This commit is contained in:
Marco Cawthorne 2025-02-09 01:36:04 -08:00
parent bdfae0ce4d
commit 6460c8af73
2 changed files with 10 additions and 7 deletions

BIN
img/tr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -737,6 +737,14 @@ CS_PlayerRemovedFromGame(entity targetPlayer)
Round_CheckUponDeath(targetPlayer);
}
void
CodeCallback_Precache(void)
{
precache.Entity("player_vip");
precache.Entity("player_terrorist");
precache.Entity("player_counterterrorist");
}
/* Callbacks, functions that are called from Nuclide */
void
CodeCallback_StartGameType(void)
@ -744,11 +752,6 @@ CodeCallback_StartGameType(void)
string spawnCT;
string spawnT;
/* players can buy these any time. so they should be precached for speed. */
precache.Entity("player_vip");
precache.Entity("player_terrorist");
precache.Entity("player_counterterrorist");
spawnCT = entityDef.GetString("player_counterterrorist", "spawnpoint");
spawnT = entityDef.GetString("player_terrorist", "spawnpoint");
@ -756,9 +759,9 @@ CodeCallback_StartGameType(void)
motd.LoadDefault();
/* the only teams CS will ever need... ? */
teams.SetUp(TEAM_T, "Terrorist", [153, 204, 255], true);
teams.SetUp(TEAM_T, "Terrorist", [255, 63, 63], true);
teams.SetSpawnPoint(TEAM_T, spawnT);
teams.SetUp(TEAM_CT, "Counter-Terrorist", [255, 63, 63], true);
teams.SetUp(TEAM_CT, "Counter-Terrorist", [153, 204, 255], true);
teams.SetSpawnPoint(TEAM_CT, spawnCT);
/* evaluate our world */