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

* fixed crash when there was no hero available to hire for some player

* pregmae wont crash if user gives wrong resolution number
* fixed 1024x600 screen resolution
* selection dialog (eg. for treasure chests) can be closed with enter key
* orientation of hero can't be change if movement points are exhausted
* numerous improvements for Tavern window (hover tips for buttons, button will be inactive if player has 8 heroes or there is a visiting hero in the town garrison)
* campfire, borderguard, bordergate, questguard will be accessible from the top
* spells not known by hero can't be casted
* restored checking mana points before casting spell
This commit is contained in:
Michał W. Urbańczyk
2009-02-09 16:18:48 +00:00
parent 445653c880
commit c83404a375
15 changed files with 167 additions and 59 deletions

View File

@ -1307,8 +1307,8 @@ upgend:
//TODO: skill level may be different on special terrain
if( // !vstd::contains(h->spells,ba.additionalInfo) //hero doesn't know this spell
/*||*/ (h->mana < s->costs[skill]) //not enough mana
if( !vstd::contains(h->spells,ba.additionalInfo) //hero doesn't know this spell
|| (h->mana < s->costs[skill]) //not enough mana
|| (ba.additionalInfo < 10) //it's adventure spell (not combat)
|| 0 )//TODO: hero has already casted a spell in this round
{
@ -1631,9 +1631,16 @@ void CGameHandler::newTurn()
{
SetAvailableHeroes sah;
sah.player = i->first;
//TODO: - will fail when there are not enough available heroes
sah.hid1 = gs->hpool.pickHeroFor(true,i->first,&VLC->townh->towns[gs->scenarioOps->getIthPlayersSettings(i->first).castle])->subID;
sah.hid2 = gs->hpool.pickHeroFor(false,i->first,&VLC->townh->towns[gs->scenarioOps->getIthPlayersSettings(i->first).castle],sah.hid1)->subID;
CGHeroInstance *h = gs->hpool.pickHeroFor(true,i->first,&VLC->townh->towns[gs->scenarioOps->getIthPlayersSettings(i->first).castle]);
if(h)
sah.hid1 = h->subID;
else
sah.hid1 = -1;
h = gs->hpool.pickHeroFor(false,i->first,&VLC->townh->towns[gs->scenarioOps->getIthPlayersSettings(i->first).castle],sah.hid1);
if(h)
sah.hid2 = h->subID;
else
sah.hid2 = -1;
sendAndApply(&sah);
}
if(i->first>=PLAYER_LIMIT) continue;