mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +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:
@@ -36,8 +36,9 @@ enum class ESerializationVersion : int32_t
|
||||
|
||||
MAP_HEADER_DISPOSED_HEROES, // map header contains disposed heroes list
|
||||
NO_RAW_POINTERS_IN_SERIALIZER, // large rework that removed all non-owning pointers from serializer
|
||||
STACK_INSTANCE_EXPERIENCE_FIX, // stack experience is stored as total, not as average
|
||||
|
||||
CURRENT = NO_RAW_POINTERS_IN_SERIALIZER,
|
||||
CURRENT = STACK_INSTANCE_EXPERIENCE_FIX,
|
||||
};
|
||||
|
||||
static_assert(ESerializationVersion::MINIMAL <= ESerializationVersion::CURRENT, "Invalid serialization version definition!");
|
||||
|
||||
@@ -226,7 +226,6 @@ void registerTypes(Serializer &s)
|
||||
s.template registerType<BulkMoveArtifacts>(173);
|
||||
s.template registerType<PlayerMessageClient>(174);
|
||||
s.template registerType<BulkRebalanceStacks>(175);
|
||||
s.template registerType<BulkSmartRebalanceStacks>(176);
|
||||
s.template registerType<SetRewardableConfiguration>(177);
|
||||
s.template registerType<CPackForServer>(179);
|
||||
s.template registerType<EndTurn>(180);
|
||||
@@ -255,7 +254,7 @@ void registerTypes(Serializer &s)
|
||||
s.template registerType<PlayerMessage>(203);
|
||||
s.template registerType<BulkSplitStack>(204);
|
||||
s.template registerType<BulkMergeStacks>(205);
|
||||
s.template registerType<BulkSmartSplitStack>(206);
|
||||
s.template registerType<BulkSplitAndRebalanceStack>(206);
|
||||
s.template registerType<BulkMoveArmy>(207);
|
||||
s.template registerType<BulkExchangeArtifacts>(208);
|
||||
s.template registerType<ManageBackpackArtifacts>(209);
|
||||
|
||||
Reference in New Issue
Block a user