CvInfos.cpp woes

Androrc the Orc

Emperor
Joined
Apr 19, 2004
Messages
1,621
Location
Vienna, Austria
Is there a way to check within the functions in CvInfos.cpp whether the game is a new game being started or a saved game being loaded when in the civilization selection screen? Which parts of a saved game have already been loaded when at the civilization selection screen?
 
I don't think that would be in CvInfos, but I could be wrong. Elaborate.
 
I don't think that would be in CvInfos, but I could be wrong. Elaborate.

I want some civilizations to not be chooseable when starting a new game, but the player could become then during the game. But if CvCivilizationInfo::isPlayable() returns false, it doesn't just stop the player from choosing that civilization at game start, it also prevents the player from loading a game that he was playing with that civilization.

So for these civilizations I need CvCivilizationInfo::isPlayable() to return false when a new game is being started, and true when a saved game is being loaded.

(there is a workaround to this; loading such a game works when loading the game during another game; but it doesn't load from the menu)
 
Try this:
Code:
GameType eGameType = GC.getInitCore().getType();

You then get the game type which is one of the following:
Code:
enum GameType				// Exposed to Python
{
	GAME_NONE = -1,

	GAME_SP_NEW,
	GAME_SP_SCENARIO,
	GAME_SP_LOAD,
	GAME_MP_NEW,
	GAME_MP_SCENARIO,
	GAME_MP_LOAD,
	GAME_HOTSEAT_NEW,
	GAME_HOTSEAT_SCENARIO,
	GAME_HOTSEAT_LOAD,
	GAME_PBEM_NEW,
	GAME_PBEM_SCENARIO,
	GAME_PBEM_LOAD,
	GAME_REPLAY,

For Single player you'd mainly care about GAME_SP_NEW and GAME_SP_LOAD.
Note that you'll also need to add this to CvInfos.cpp if you intend to use this there:
Code:
#include "CvInitCore.h"
 
Back
Top Bottom