浏览代码

fix crash when creature level is 0

kdmcser 5 月之前
父节点
当前提交
9310ff3b7a
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/bonuses/Updaters.cpp

+ 1 - 0
lib/bonuses/Updaters.cpp

@@ -175,6 +175,7 @@ std::shared_ptr<Bonus> DivideStackLevelUpdater::apply(const std::shared_ptr<Bonu
 		return b; // e.g. war machines & other special units
 
 	auto newBonus = std::make_shared<Bonus>(*b);
+	level = std::max(1, level);
 	newBonus->val /= level;
 	newBonus->updater = nullptr; // prevent double-apply
 	return newBonus;