2
0
Эх сурвалжийг харах

formatting fix and code simplification in HeroBonus

Henning Koehler 7 жил өмнө
parent
commit
89cb7b2780
2 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 1 3
      lib/HeroBonus.cpp
  2. 2 0
      lib/HeroBonus.h

+ 1 - 3
lib/HeroBonus.cpp

@@ -1759,9 +1759,7 @@ const std::shared_ptr<Bonus> GrowsWithLevelUpdater::update(const std::shared_ptr
 
 std::string GrowsWithLevelUpdater::toString() const
 {
-	char buf[100];
-	sprintf(buf, "GrowsWithLevelUpdater(valPer20=%d, stepSize=%d)", valPer20, stepSize);
-	return std::string(buf);
+	return boost::str(boost::format("GrowsWithLevelUpdater(valPer20=%d, stepSize=%d)") % valPer20 % stepSize);
 }
 
 JsonNode GrowsWithLevelUpdater::toJsonNode() const

+ 2 - 0
lib/HeroBonus.h

@@ -367,7 +367,9 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this<Bonus>
 		h & limiter;
 		h & propagator;
 		if(version >= 781)
+		{
 			h & updater;
+		}
 	}
 
 	template <typename Ptr>