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

@ -617,17 +617,21 @@ void CGameState::applyNL(IPack * pack)
{
SetAvailableHeroes *rh = static_cast<SetAvailableHeroes*>(pack);
players[rh->player].availableHeroes.clear();
players[rh->player].availableHeroes.push_back(hpool.heroesPool[rh->hid1]);
players[rh->player].availableHeroes.push_back(hpool.heroesPool[rh->hid2]);
if(rh->flags & 1)
CGHeroInstance *h = (rh->hid1>=0 ? hpool.heroesPool[rh->hid1] : NULL);
players[rh->player].availableHeroes.push_back(h);
if(h && rh->flags & 1)
{
hpool.heroesPool[rh->hid1]->army.slots.clear();
hpool.heroesPool[rh->hid1]->army.slots[0] = std::pair<ui32,si32>(VLC->creh->nameToID[hpool.heroesPool[rh->hid1]->type->refTypeStack[0]],1);
h->army.slots.clear();
h->army.slots[0] = std::pair<ui32,si32>(VLC->creh->nameToID[h->type->refTypeStack[0]],1);
}
h = (rh->hid2>=0 ? hpool.heroesPool[rh->hid2] : NULL);
players[rh->player].availableHeroes.push_back(h);
if(rh->flags & 2)
{
hpool.heroesPool[rh->hid2]->army.slots.clear();
hpool.heroesPool[rh->hid2]->army.slots[0] = std::pair<ui32,si32>(VLC->creh->nameToID[hpool.heroesPool[rh->hid2]->type->refTypeStack[0]],1);
h->army.slots.clear();
h->army.slots[0] = std::pair<ui32,si32>(VLC->creh->nameToID[h->type->refTypeStack[0]],1);
}
break;
}