From 1f0a1bd7715897e1e822fc61cf5c7825c4d54fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Fri, 28 Aug 2009 19:34:08 +0000 Subject: [PATCH] More fixes. --- AI/GeniusAI/BattleHelper.cpp | 1 + AI/GeniusAI/CGeniusAI.cpp | 1 + client/CPreGame.cpp | 6 ++++-- server/CGameHandler.cpp | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AI/GeniusAI/BattleHelper.cpp b/AI/GeniusAI/BattleHelper.cpp index aa670d610..e0c263422 100644 --- a/AI/GeniusAI/BattleHelper.cpp +++ b/AI/GeniusAI/BattleHelper.cpp @@ -5,6 +5,7 @@ #include #include #include +#include using namespace GeniusAI::BattleAI; using namespace std; diff --git a/AI/GeniusAI/CGeniusAI.cpp b/AI/GeniusAI/CGeniusAI.cpp index bc4af4b8c..8353966d6 100644 --- a/AI/GeniusAI/CGeniusAI.cpp +++ b/AI/GeniusAI/CGeniusAI.cpp @@ -5,6 +5,7 @@ #include "../../hch/CHeroHandler.h" #include "../../lib/VCMI_Lib.h" #include "../../lib/NetPacks.h" +#include using namespace std; using namespace GeniusAI; diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 4635019a1..8a8ce2410 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -27,6 +27,7 @@ #include "../hch/CCreatureHandler.h" #include "CPlayerInterface.h" #include "../CCallback.h" +#include /* * CPreGame.cpp, part of VCMI engine * @@ -366,7 +367,7 @@ void CSelectionScreen::startGame() if(!(sel && sel->txt && sel->txt->text.size())) return; - selectedName = sel->txt->text; + selectedName = "Games/" + sel->txt->text + ".vlgm1"; LOCPLINT->cb->save(sel->txt->text); GH.popIntTotally(this); } @@ -555,7 +556,7 @@ SelectionTab::SelectionTab(EState Type, const boost::function if(selectedName[0] == 'M') txt->setText("NEWGAME"); else - selectFName("Games/" + selectedName + ".vlgm1"); + selectFName(selectedName); } } } @@ -1642,6 +1643,7 @@ void CTextInput::clickLeft( tribool down, bool previousState ) void CTextInput::keyPressed( const SDL_KeyboardEvent & key ) { + if(key.state != SDL_PRESSED) return; switch(key.keysym.sym) { case SDLK_BACKSPACE: diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index faabea5d3..7a791767d 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -327,6 +327,7 @@ void CGameHandler::startBattle(const CArmedInstance *army1, const CArmedInstance BattleInfo *curB = new BattleInfo; curB->side1 = army1->tempOwner; curB->side2 = army2->tempOwner; + if(curB->side2 == 254) curB->side2 = 255; setupBattle(curB, tile, army1->army, army2->army, hero1, hero2, creatureBank, town); //initializes stacks, places creatures on battlefield, blocks and informs player interfaces NEW_ROUND; //TODO: pre-tactic stuff, call scripts etc.