diff --git a/AI/GeniusAI/CGeniusAI.cpp b/AI/GeniusAI/CGeniusAI.cpp index ba62951b6..f718e2e87 100644 --- a/AI/GeniusAI/CGeniusAI.cpp +++ b/AI/GeniusAI/CGeniusAI.cpp @@ -231,14 +231,14 @@ ui8 side; //who made this action: false - left, true - right player CBattleHelper::CBattleHelper(): InfiniteDistance(0xffff), - BattlefieldHeight(11), BattlefieldWidth(15), + BattlefieldHeight(11), + m_voteForMaxDamage(10), + m_voteForMinDamage(10), + m_voteForMaxSpeed(10), m_voteForDistance(10), m_voteForDistanceFromShooters(20), - m_voteForHitPoints(10), - m_voteForMaxDamage(10), - m_voteForMaxSpeed(10), - m_voteForMinDamage(10) + m_voteForHitPoints(10) { // loads votes std::fstream f; @@ -373,9 +373,9 @@ int CBattleHelper::GetDistanceWithObstacles(int pointA, int pointB) * Implementation of CBattleLogic class. */ CBattleLogic::CBattleLogic(ICallback *cb, CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side) : - m_cb(cb), m_iCurrentTurn(-2), m_bIsAttacker(false), + m_cb(cb), m_army1(army1), m_army2(army2), m_tile(tile), diff --git a/CBattleInterface.cpp b/CBattleInterface.cpp index 1ba56910f..3abd3d012 100644 --- a/CBattleInterface.cpp +++ b/CBattleInterface.cpp @@ -44,9 +44,10 @@ struct CMP_stack2 } cmpst2 ; CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect) - : attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), activeStack(-1), givenCommand(NULL), - attackingInfo(NULL), myTurn(false), resWindow(NULL), showStackQueue(false), - spellDestSelectMode(false), spellToCast(NULL), previouslyHoveredHex(-1), moveStarted(false), mouseHoveredStack(-1) + : attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), activeStack(-1), + mouseHoveredStack(-1), previouslyHoveredHex(-1), spellDestSelectMode(false), spellToCast(NULL), + attackingInfo(NULL), givenCommand(NULL), myTurn(false), resWindow(NULL), + showStackQueue(false), moveStarted(false) { pos = myRect; strongInterest = true; @@ -2336,7 +2337,7 @@ void CBattleHero::clickLeft(boost::logic::tribool down) } } -CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): phase(phaseG), image(imageG), flip(flipG), flagAnim(0), myHero(hero), myOwner(owner), nextPhase(-1) +CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): flip(flipG), myHero(hero), myOwner(owner), phase(phaseG), nextPhase(-1), image(imageG), flagAnim(0) { dh = CDefHandler::giveDef( defName ); for(int i=0; iourImages.size(); ++i) //transforming images @@ -2425,7 +2426,7 @@ void CBattleHex::hover(bool on) } } -CBattleHex::CBattleHex() : myNumber(-1), accesible(true), hovered(false), strictHovered(false), myInterface(NULL), setAlterText(false) +CBattleHex::CBattleHex() : setAlterText(false), myNumber(-1), accesible(true), hovered(false), strictHovered(false), myInterface(NULL) { } diff --git a/CGameState.cpp b/CGameState.cpp index a8365fb19..8dadb585d 100644 --- a/CGameState.cpp +++ b/CGameState.cpp @@ -435,8 +435,8 @@ std::pair< std::vector, int > BattleInfo::getPath(int start, int dest, bool } CStack::CStack(CCreature * C, int A, int O, int I, bool AO, int S) - :creature(C),amount(A), baseAmount(A), owner(O), position(-1), ID(I), attackerOwned(AO), firstHPleft(C->hitPoints), - shots(C->shots), slot(S), counterAttacks(1), effects(), state() + :ID(I), creature(C), amount(A), baseAmount(A), firstHPleft(C->hitPoints), owner(O), slot(S), attackerOwned(AO), position(-1), + counterAttacks(1), shots(C->shots), state(), effects() { speed = creature->speed; abilities = C->abilities; diff --git a/CGameState.h b/CGameState.h index 497a65e27..a2903f6a5 100644 --- a/CGameState.h +++ b/CGameState.h @@ -159,7 +159,7 @@ public: std::vector effects; CStack(CCreature * C, int A, int O, int I, bool AO, int S); - CStack() : creature(NULL),amount(-1),owner(255), position(-1), ID(-1), attackerOwned(true), firstHPleft(-1), slot(255), baseAmount(-1), counterAttacks(1), effects(), state(), abilities(){} + CStack() : ID(-1), creature(NULL), amount(-1), baseAmount(-1), firstHPleft(-1), owner(255), slot(255), attackerOwned(true), position(-1), counterAttacks(1), abilities(), state(), effects() {} const StackEffect * getEffect(ui16 id) const; //effect id (SP) bool willMove(); //if stack has remaining move this turn ui32 Speed() const; diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index b149fc4e9..0990a715c 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -522,8 +522,8 @@ void CGarrisonInt::splitStacks(int am2) } CGarrisonInt::CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1, const CArmedInstance *s2) - :interx(inx),intery(iny),sur(pomsur),highlighted(NULL),sup(NULL),sdown(NULL),oup(s1),odown(s2), - offx(OX),offy(OY) + :interx(inx),intery(iny),highlighted(NULL),sur(pomsur),offx(OX),offy(OY),sup(NULL), + sdown(NULL),oup(s1),odown(s2) { active = false; splitting = false; @@ -641,7 +641,7 @@ void CRClickPopup::close() } CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free) -:bitmap(Bitmap),free(Free) + :free(Free),bitmap(Bitmap) { pos.x = x; pos.y = y; @@ -3589,7 +3589,7 @@ void CCreInfoWindow::show(SDL_Surface * to) } CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function Upg, boost::function Dsm, UpgradeInfo *ui) -:ok(0),dismiss(0),upgrade(0),type(Type),dsm(Dsm) +:type(Type),dsm(Dsm),dismiss(0),upgrade(0),ok(0) { //active = false; anf = 0; @@ -4724,7 +4724,7 @@ void CInGameConsole::refreshEnteredText() } } -CInGameConsole::CInGameConsole() : defaultTimeout(10000), maxDisplayedTexts(10), prevEntDisp(-1) +CInGameConsole::CInGameConsole() : prevEntDisp(-1), defaultTimeout(10000), maxDisplayedTexts(10) { } diff --git a/CPreGame.cpp b/CPreGame.cpp index f4d6bf50c..4ff5ed795 100644 --- a/CPreGame.cpp +++ b/CPreGame.cpp @@ -444,13 +444,13 @@ PreGameTab::PreGameTab() } /********************************************************************************************/ Options::PlayerOptions::PlayerOptions(int serial, int player) - :Cleft(genRect(24,11,164,133+serial*50),CPG->ourOptions->left,true,-1), //left castle arrow + :flag(genRect(50,42,14,130+serial*50),CPG->ourOptions->flags[player],player), + Cleft(genRect(24,11,164,133+serial*50),CPG->ourOptions->left,true,-1), //left castle arrow Cright(genRect(24,11,225,133+serial*50),CPG->ourOptions->right,false,-1), //right castle arrow Hleft(genRect(24,11,240,133+serial*50),CPG->ourOptions->left,true,0), //left hero arrow Hright(genRect(24,11,301,133+serial*50),CPG->ourOptions->right,false,0), //right hero arrow Bleft(genRect(24,11,316,133+serial*50),CPG->ourOptions->left,true,1), //left bonus arrow - Bright(genRect(24,11,377,133+serial*50),CPG->ourOptions->right,false,1), //right bonus arrow - flag(genRect(50,42,14,130+serial*50),CPG->ourOptions->flags[player],player) + Bright(genRect(24,11,377,133+serial*50),CPG->ourOptions->right,false,1) //right bonus arrow { Bleft.playerID=Bright.playerID=Hleft.playerID=Hright.playerID=Cleft.playerID=Cright.playerID=player; Bleft.serialID=Bright.serialID=Hleft.serialID=Hright.serialID=Cleft.serialID=Cright.serialID=serial; @@ -2508,17 +2508,17 @@ CPreGame::menuItems::~menuItems() ScenSel::ScenSel() : difficulty(new CPoinGroup()), + bScens(genRect(0,0,414,81),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")), + bOptions(genRect(0,0,414,509),boost::bind(&CPreGame::showOptions,CPG),CDefHandler::giveDef("GSPBUTT.DEF")), + bRandom(genRect(0,0,414,105),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")), + bBegin(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRBEG.DEF")), + bLoad(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRLOD.DEF")), + bBack(genRect(0,0,584,535),boost::bind(&CPreGame::showNewMenu,CPG),CDefHandler::giveDef("SCNRBACK.DEF")), bEasy(genRect(0,0,506,456),NULL,CDefHandler::giveDef("GSPBUT3.DEF"),true,difficulty,0), bNormal(genRect(0,0,538,456),NULL,CDefHandler::giveDef("GSPBUT4.DEF"),true,difficulty,1), bHard(genRect(0,0,570,456),NULL,CDefHandler::giveDef("GSPBUT5.DEF"),true,difficulty,2), bExpert(genRect(0,0,602,456),NULL,CDefHandler::giveDef("GSPBUT6.DEF"),true,difficulty,3), - bImpossible(genRect(0,0,634,456),NULL,CDefHandler::giveDef("GSPBUT7.DEF"),true,difficulty,4), - bBack(genRect(0,0,584,535),boost::bind(&CPreGame::showNewMenu,CPG),CDefHandler::giveDef("SCNRBACK.DEF")), - bBegin(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRBEG.DEF")), - bLoad(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRLOD.DEF")), - bScens(genRect(0,0,414,81),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")), - bRandom(genRect(0,0,414,105),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")), - bOptions(genRect(0,0,414,509),boost::bind(&CPreGame::showOptions,CPG),CDefHandler::giveDef("GSPBUTT.DEF")) + bImpossible(genRect(0,0,634,456),NULL,CDefHandler::giveDef("GSPBUT7.DEF"),true,difficulty,4) { pressed=NULL; listShowed=false; diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 6cf9348c2..1fafd94e2 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -45,10 +45,10 @@ struct DLL_EXPORT HeroBonus std::string description; HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, std::string Desc, si32 Subtype=-1) - :duration(Dur), type(Type), source(Src), val(Val), id(ID), description(Desc), subtype(Subtype) + :duration(Dur), type(Type), subtype(Subtype), source(Src), val(Val), id(ID), description(Desc) {} HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, si32 Subtype=-1) - :duration(Dur), type(Type), source(Src), val(Val), id(ID), subtype(Subtype) + :duration(Dur), type(Type), subtype(Subtype), source(Src), val(Val), id(ID) {} HeroBonus() { diff --git a/lib/NetPacks.h b/lib/NetPacks.h index 41b2c7b94..0a2a4ae1a 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -895,7 +895,7 @@ struct DisbandCreature : public CPackForServer struct BuildStructure : public CPackForServer { BuildStructure(){}; - BuildStructure(si32 TID, si32 BID):tid(TID),bid(BID){}; + BuildStructure(si32 TID, si32 BID):bid(BID),tid(TID){}; si32 bid, tid; //structure and town ids void applyGh(CGameHandler *gh); diff --git a/mapHandler.cpp b/mapHandler.cpp index c011b3646..3bf180789 100644 --- a/mapHandler.cpp +++ b/mapHandler.cpp @@ -1403,5 +1403,5 @@ CMapHandler::CMapHandler() } TerrainTile2::TerrainTile2() -:terbitmap(0),tileInfo(0) + :tileInfo(0),terbitmap(0) {}