diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index 7b71ac027..291e84bf6 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -1565,6 +1565,16 @@ void LimiterList::add( TLimiterPtr limiter ) limiters.push_back(limiter); } +// Updaters + +IUpdater::~IUpdater() +{ +} + +ScalingUpdater::ScalingUpdater() : valPer20(0), stepSize(1) +{ +} + ScalingUpdater::ScalingUpdater(int valPer20, int stepSize) : valPer20(valPer20), stepSize(stepSize) { } diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 21dfb5fac..2c476f17e 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -1020,6 +1020,8 @@ void BonusList::insert(const int position, InputIterator first, InputIterator la class DLL_LINKAGE IUpdater { public: + virtual ~IUpdater(); + virtual bool update(Bonus & b, const CBonusSystemNode & context) const = 0; template void serialize(Handler &h, const int version) @@ -1032,11 +1034,12 @@ struct DLL_LINKAGE ScalingUpdater : public IUpdater int valPer20; int stepSize; + ScalingUpdater(); ScalingUpdater(int valPer20, int stepSize = 1); template void serialize(Handler &h, const int version) { - IUpdater::serialize(h, version); + h & static_cast(*this); h & valPer20; h & stepSize; } diff --git a/lib/registerTypes/RegisterTypes.h b/lib/registerTypes/RegisterTypes.h index 9c4960fc3..93dcc1244 100644 --- a/lib/registerTypes/RegisterTypes.h +++ b/lib/registerTypes/RegisterTypes.h @@ -181,6 +181,9 @@ void registerTypesMapObjects2(Serializer &s) s.template registerType(); s.template registerType(); + // Updaters + s.template registerType(); + // s.template registerType(); s.template registerType(); s.template registerType();