1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

CQuest: add proper constructor to avoid uninitialized fields

This commit is contained in:
Arseniy Shestakov 2016-08-22 20:41:37 +03:00
parent 111f080639
commit 52e660f087
2 changed files with 8 additions and 1 deletions

View File

@ -23,6 +23,13 @@
std::map <PlayerColor, std::set <ui8> > CGKeys::playerKeyMap;
CQuest::CQuest()
: qid(-1), missionType(MISSION_NONE), progress(NOT_ACTIVE), lastDay(-1), m13489val(0),
textOption(0), completedOption(0), stackDirection(0), heroPortrait(-1),
isCustomFirst(false), isCustomNext(false), isCustomComplete(false)
{
}
///helpers
static void showInfoDialog(const PlayerColor playerID, const ui32 txtID, const ui16 soundID)
{

View File

@ -50,7 +50,7 @@ public:
std::string firstVisitText, nextVisitText, completedText;
bool isCustomFirst, isCustomNext, isCustomComplete;
CQuest(){missionType = MISSION_NONE;}; //default constructor
CQuest();
virtual ~CQuest(){};
virtual bool checkQuest (const CGHeroInstance * h) const; //determines whether the quest is complete or not