mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
- if special victory condition is present AND there is only one player normal victory condition will be disabled - added new triggered condition, constant value - if target of CONTROL/DESTROY condition is removed from map, triggered condition will be replaced with constant - fixed randomization of armies with random stacks
This commit is contained in:
@ -7162,17 +7162,18 @@ void CGLighthouse::giveBonusTo( PlayerColor player ) const
|
||||
|
||||
void CArmedInstance::randomizeArmy(int type)
|
||||
{
|
||||
int max = VLC->creh->creatures.size();
|
||||
for (auto & elem : stacks)
|
||||
{
|
||||
int randID = elem.second->idRand;
|
||||
if(randID > max)
|
||||
int & randID = elem.second->idRand;
|
||||
if(randID >= 0)
|
||||
{
|
||||
int level = (randID-VLC->creh->creatures.size()) / 2 -1;
|
||||
bool upgrade = !(randID % 2);
|
||||
int level = randID / 2;
|
||||
bool upgrade = randID % 2;
|
||||
elem.second->setType(VLC->townh->factions[type]->town->creatures[level][upgrade]);
|
||||
}
|
||||
|
||||
randID = -1;
|
||||
}
|
||||
assert(elem.second->valid(false));
|
||||
assert(elem.second->armyObj == this);
|
||||
}
|
||||
return;
|
||||
|
Reference in New Issue
Block a user