Bazaar developer reference

CvPreGame::setGameType(const CvString &)

Defined in
CvPreGame.cpp, line 2558
Hook name
CivHooks::CvPreGame_setGameType_with_const_CvString

Hooks

static bool BeforeCvPreGame_setGameType_with_const_CvString(const CvString& g);static void AfterCvPreGame_setGameType_with_const_CvString(const CvString& g);static void ReplaceCvPreGame_setGameType_with_const_CvString(void (*original)(const CvString&), const CvString& g);CivRegisterBefore<CivHooks::CvPreGame_setGameType_with_const_CvString>(host, &BeforeCvPreGame_setGameType_with_const_CvString);CivRegisterAfter<CivHooks::CvPreGame_setGameType_with_const_CvString>(host, &AfterCvPreGame_setGameType_with_const_CvString);CivRegisterReplace<CivHooks::CvPreGame_setGameType_with_const_CvString>(host, &ReplaceCvPreGame_setGameType_with_const_CvString);

Code

2558void setGameType(const CvString& g)2559{2560	if(_stricmp(g.GetCString(), "singleplayer") == 0)2561	{2562		setGameType(GAME_SINGLE_PLAYER, GAME_NEW);2563	}2564	else if(_stricmp(g.GetCString(), "spload") == 0)2565	{2566		setGameType(GAME_SINGLE_PLAYER, GAME_LOADED);2567	}2568	else2569	{2570		//CvAssertMsg(false, "Invalid game type in ini file!");2571		setGameType(GAME_TYPE_NONE);2572	}25732574#if defined(MOD_BUGFIX_MINOR)2575	// Don't need this code as it's included in the setGameType() calls above2576#else2577	if(s_gameType != GAME_NETWORK_MULTIPLAYER)2578		s_isInternetGame = false;2579#endif2580}

Calls

Called by