mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
- fixed out of sync hero armies
- one more crash in garrison
This commit is contained in:
@ -371,8 +371,11 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int countLeft = owner->getSelection()->myStack ? owner->getSelection()->myStack->count : 0;
|
||||||
|
int countRight = myStack ? myStack->count : 0;
|
||||||
|
|
||||||
GH.pushInt(new CSplitWindow(owner->getSelection()->creature, boost::bind(&CGarrisonInt::splitStacks, owner, _1, _2),
|
GH.pushInt(new CSplitWindow(owner->getSelection()->creature, boost::bind(&CGarrisonInt::splitStacks, owner, _1, _2),
|
||||||
minLeft, minRight, owner->getSelection()->myStack->count, myStack->count));
|
minLeft, minRight, countLeft, countRight));
|
||||||
refr = true;
|
refr = true;
|
||||||
}
|
}
|
||||||
else if(creature != owner->getSelection()->creature) //swap
|
else if(creature != owner->getSelection()->creature) //swap
|
||||||
|
@ -494,7 +494,10 @@ int CGameState::pickHero(int owner)
|
|||||||
for (si32 i=firstHero; i<lastHero; i++)
|
for (si32 i=firstHero; i<lastHero; i++)
|
||||||
factionHeroes.push_back(i);
|
factionHeroes.push_back(i);
|
||||||
// we need random order to select hero
|
// we need random order to select hero
|
||||||
std::random_shuffle(factionHeroes.begin(), factionHeroes.end());
|
std::random_shuffle(factionHeroes.begin(), factionHeroes.end(), [](size_t range)
|
||||||
|
{
|
||||||
|
return ran() % range;
|
||||||
|
});
|
||||||
|
|
||||||
for (size_t i=0; i<factionHeroes.size(); i++)
|
for (size_t i=0; i<factionHeroes.size(); i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user