1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Fix discovered bugs from develop branch

This commit is contained in:
Ivan Savenko
2025-04-27 15:53:03 +03:00
parent a8a74888f7
commit 04c9e27ccd
3 changed files with 8 additions and 5 deletions

View File

@ -171,6 +171,9 @@ JsonNode TimesStackLevelUpdater::toJsonNode() const
std::shared_ptr<Bonus> DivideStackLevelUpdater::apply(const std::shared_ptr<Bonus> & b, int level) const
{
if (level == 0)
return b; // e.g. war machines & other special units
auto newBonus = std::make_shared<Bonus>(*b);
newBonus->val /= level;
newBonus->updater = nullptr; // prevent double-apply