1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

* capitol bar in town hall is grey (not red) if already one exists

* disabled autosaving on first turn
* bonuses from bonus artifacts
* fixed crash on battle with neutral creatures
* minor improvements
This commit is contained in:
Michał W. Urbańczyk
2009-07-10 23:40:10 +00:00
parent 7d9da8974d
commit db2f8c1d7c
8 changed files with 44 additions and 32 deletions

View File

@@ -938,7 +938,8 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
//adding native terrain bonuses
for(int g=0; g<stacks.size(); ++g)
{
if( VLC->heroh->nativeTerrains[stacks[g]->creature->faction] == gs->map->terrain[tile.x][tile.y][tile.z].tertype )
int faction = stacks[g]->creature->faction;
if(faction >= 0 && VLC->heroh->nativeTerrains[faction] == gs->map->terrain[tile.x][tile.y][tile.z].tertype )
{
stacks[g]->features.push_back(makeFeature(StackFeature::SPEED_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
stacks[g]->features.push_back(makeFeature(StackFeature::ATTACK_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
@@ -995,7 +996,7 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
stacks.back()->luck = hero2->getCurrentLuck(stacks.back()->ID,false);
}
}
//war machiens added
//war machines added
std::stable_sort(stacks.begin(),stacks.end(),cmpst);
//randomize obstacles
@@ -1674,13 +1675,21 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid )
ns.bid.insert(19);
else if(t->getHordeLevel(1) == (bid-37))
ns.bid.insert(25);
}
else if(bid >= 30) //bas. dwelling
{
SetAvailableCreatures ssi;
ssi.tid = tid;
ssi.creatures = t->creatures;
ssi.creatures[bid-30].first = VLC->creh->creatures[t->town->basicCreatures[bid-30]].growth;
ssi.creatures[bid-37].second.push_back(t->town->upgradedCreatures[bid-37]);
sendAndApply(&ssi);
}
else if(bid >= 30) //bas. dwelling
{
int crid = t->town->basicCreatures[bid-30];
SetAvailableCreatures ssi;
ssi.tid = tid;
ssi.creatures = t->creatures;
ssi.creatures[bid-30].first = VLC->creh->creatures[crid].growth;
ssi.creatures[bid-30].second.push_back(crid);
sendAndApply(&ssi);
}