mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +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:
@ -197,7 +197,7 @@ void Rewardable::Interface::grantRewardAfterLevelup(const Rewardable::VisitInfo
|
||||
{
|
||||
CCreatureSet creatures;
|
||||
for(const auto & crea : info.reward.creatures)
|
||||
creatures.addToSlot(creatures.getFreeSlot(), std::make_unique<CStackInstance>(cb, crea.getId(), crea.count));
|
||||
creatures.addToSlot(creatures.getFreeSlot(), std::make_unique<CStackInstance>(cb, crea.getId(), crea.getCount()));
|
||||
|
||||
if(auto * army = dynamic_cast<const CArmedInstance*>(this)) //TODO: to fix that, CArmedInstance must be split on map instance part and interface part
|
||||
cb->giveCreatures(army, hero, creatures, false);
|
||||
|
Reference in New Issue
Block a user