MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnStartGame

Function OnStartGame

src/openttd.cpp:848–858  ·  view source on GitHub ↗

* Triggers everything that should be triggered when starting a game. * @param dedicated_server Whether this is a dedicated server or not. */

Source from the content-addressed store, hash-verified

846 * @param dedicated_server Whether this is a dedicated server or not.
847 */
848static void OnStartGame(bool dedicated_server)
849{
850 /* Update the local company for a loaded game. It is either the first available company
851 * or in the case of a dedicated server, a spectator */
852 SetLocalCompany(dedicated_server ? COMPANY_SPECTATOR : GetFirstPlayableCompanyID());
853
854 NetworkOnGameStart();
855
856 /* Execute the game-start script */
857 IConsoleCmdExec("exec scripts/game_start.scr 0");
858}
859
860static void MakeNewGameDone()
861{

Callers 2

MakeNewGameDoneFunction · 0.85
SwitchToModeFunction · 0.85

Calls 4

SetLocalCompanyFunction · 0.85
NetworkOnGameStartFunction · 0.85
IConsoleCmdExecFunction · 0.85

Tested by

no test coverage detected