From e4cec7319e80cdb034d6bc3a579849f77a1f4547 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 18 Jul 2012 00:21:39 +0000 Subject: [PATCH] - added more error checking in scenarios --- source/glest_game/world/scenario.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/source/glest_game/world/scenario.h b/source/glest_game/world/scenario.h index b57ff8cd..e789e841 100644 --- a/source/glest_game/world/scenario.h +++ b/source/glest_game/world/scenario.h @@ -43,7 +43,34 @@ enum Difficulty { dInsane }; -struct ScenarioInfo { +class ScenarioInfo { + +public: + ScenarioInfo() { + difficulty = 0; + for(unsigned int i = 0; i < GameConstants::maxPlayers; ++i) { + factionControls[i] = ctClosed; + teams[i] = 0; + factionTypeNames[i] = ""; + resourceMultipliers[i] = 0; + } + + mapName = ""; + tilesetName = ""; + techTreeName = ""; + + defaultUnits = false; + defaultResources = false; + defaultVictoryConditions = false; + + desc = ""; + + fogOfWar = false; + fogOfWar_exploredFlag = false; + + file = ""; + name = ""; + } int difficulty; ControlType factionControls[GameConstants::maxPlayers]; int teams[GameConstants::maxPlayers];