1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

More fixes.

This commit is contained in:
Michał W. Urbańczyk
2009-08-28 19:34:08 +00:00
parent e746313565
commit 1f0a1bd771
4 changed files with 7 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
#include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
using namespace GeniusAI::BattleAI; using namespace GeniusAI::BattleAI;
using namespace std; using namespace std;

View File

@@ -5,6 +5,7 @@
#include "../../hch/CHeroHandler.h" #include "../../hch/CHeroHandler.h"
#include "../../lib/VCMI_Lib.h" #include "../../lib/VCMI_Lib.h"
#include "../../lib/NetPacks.h" #include "../../lib/NetPacks.h"
#include <boost/lexical_cast.hpp>
using namespace std; using namespace std;
using namespace GeniusAI; using namespace GeniusAI;

View File

@@ -27,6 +27,7 @@
#include "../hch/CCreatureHandler.h" #include "../hch/CCreatureHandler.h"
#include "CPlayerInterface.h" #include "CPlayerInterface.h"
#include "../CCallback.h" #include "../CCallback.h"
#include <boost/lexical_cast.hpp>
/* /*
* CPreGame.cpp, part of VCMI engine * CPreGame.cpp, part of VCMI engine
* *
@@ -366,7 +367,7 @@ void CSelectionScreen::startGame()
if(!(sel && sel->txt && sel->txt->text.size())) if(!(sel && sel->txt && sel->txt->text.size()))
return; return;
selectedName = sel->txt->text; selectedName = "Games/" + sel->txt->text + ".vlgm1";
LOCPLINT->cb->save(sel->txt->text); LOCPLINT->cb->save(sel->txt->text);
GH.popIntTotally(this); GH.popIntTotally(this);
} }
@@ -555,7 +556,7 @@ SelectionTab::SelectionTab(EState Type, const boost::function<void(CMapInfo *)>
if(selectedName[0] == 'M') if(selectedName[0] == 'M')
txt->setText("NEWGAME"); txt->setText("NEWGAME");
else 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 ) void CTextInput::keyPressed( const SDL_KeyboardEvent & key )
{ {
if(key.state != SDL_PRESSED) return;
switch(key.keysym.sym) switch(key.keysym.sym)
{ {
case SDLK_BACKSPACE: case SDLK_BACKSPACE:

View File

@@ -327,6 +327,7 @@ void CGameHandler::startBattle(const CArmedInstance *army1, const CArmedInstance
BattleInfo *curB = new BattleInfo; BattleInfo *curB = new BattleInfo;
curB->side1 = army1->tempOwner; curB->side1 = army1->tempOwner;
curB->side2 = army2->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 setupBattle(curB, tile, army1->army, army2->army, hero1, hero2, creatureBank, town); //initializes stacks, places creatures on battlefield, blocks and informs player interfaces
NEW_ROUND; NEW_ROUND;
//TODO: pre-tactic stuff, call scripts etc. //TODO: pre-tactic stuff, call scripts etc.