mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods - CStackInstance::experience renamed to totalExperience and now stores total stack experience (multiplied by stack size) to reduce rounding errors - CStackInstance::totalExperience is now private with accessors methods - stack experience is now automatically reallocated on stack management - Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates BulkRebalanceStacks - Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop unclear "smart" in name - Reworked split-and-rebalance logic to correctly reallocate stack experience
This commit is contained in:
@@ -112,15 +112,15 @@ bool CQuest::checkMissionArmy(const CQuest * q, const CCreatureSet * army)
|
||||
{
|
||||
if(it->second->getType() == cre->getType())
|
||||
{
|
||||
count += it->second->count;
|
||||
count += it->second->getCount();
|
||||
slotsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if(static_cast<TQuantity>(count) < cre->count) //not enough creatures of this kind
|
||||
if(static_cast<TQuantity>(count) < cre->getCount()) //not enough creatures of this kind
|
||||
return false;
|
||||
|
||||
hasExtraCreatures |= static_cast<TQuantity>(count) > cre->count;
|
||||
hasExtraCreatures |= static_cast<TQuantity>(count) > cre->getCount();
|
||||
}
|
||||
|
||||
return hasExtraCreatures || slotsCount < army->Slots().size();
|
||||
|
||||
Reference in New Issue
Block a user