1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

- blocked retreating from castle. Escape Tunnel implemented.

- fixed crash when player have no hero (like castle defence)
- minor fixes
This commit is contained in:
Ivan Savenko
2010-08-19 11:03:33 +00:00
parent 8319e5e703
commit d732565002
6 changed files with 34 additions and 7 deletions

View File

@ -1197,6 +1197,8 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
bOptions = new AdventureMapButton (CGI->generaltexth->zelp[381].first, CGI->generaltexth->zelp[381].second, boost::bind(&CBattleInterface::bOptionsf,this), 3 + pos.x, 561 + pos.y, "icm003.def", SDLK_o);
bSurrender = new AdventureMapButton (CGI->generaltexth->zelp[379].first, CGI->generaltexth->zelp[379].second, boost::bind(&CBattleInterface::bSurrenderf,this), 54 + pos.x, 561 + pos.y, "icm001.def", SDLK_s);
bFlee = new AdventureMapButton (CGI->generaltexth->zelp[380].first, CGI->generaltexth->zelp[380].second, boost::bind(&CBattleInterface::bFleef,this), 105 + pos.x, 561 + pos.y, "icm002.def", SDLK_r);
bSurrender->block(!curInt->cb->battleCanFlee());
bFlee->block(!curInt->cb->battleCanFlee());
bAutofight = new AdventureMapButton (CGI->generaltexth->zelp[382].first, CGI->generaltexth->zelp[382].second, boost::bind(&CBattleInterface::bAutofightf,this), 157 + pos.x, 561 + pos.y, "icm004.def", SDLK_a);
bSpell = new AdventureMapButton (CGI->generaltexth->zelp[385].first, CGI->generaltexth->zelp[385].second, boost::bind(&CBattleInterface::bSpellf,this), 645 + pos.x, 561 + pos.y, "icm005.def", SDLK_c);
bSpell->block(true);
@ -2915,6 +2917,8 @@ void CBattleInterface::activateStack()
//block cast spell button if hero doesn't have a spellbook
bSpell->block(!curInt->cb->battleCanCastSpell());
bSurrender->block(!curInt->cb->battleCanFlee());
bFlee->block(!curInt->cb->battleCanFlee());
GH.fakeMouseMove();