diff --git a/lib/mapObjects/CGTownInstance.h b/lib/mapObjects/CGTownInstance.h index c283000d7..b636b16a5 100644 --- a/lib/mapObjects/CGTownInstance.h +++ b/lib/mapObjects/CGTownInstance.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "CObjectHandler.h" #include "CGMarket.h" // For IMarket interface @@ -52,11 +52,7 @@ public: CSpecObjInfo * info; //h3m info about dewlling TCreaturesSet creatures; //creatures[level] -> - template void serialize(Handler &h, const int version) - { - h & static_cast(*this) & creatures; - } - +private: void initObj() override; void onHeroVisit(const CGHeroInstance * h) const override; void newTurn() const override; @@ -64,9 +60,14 @@ public: void battleFinished(const CGHeroInstance *hero, const BattleResult &result) const override; void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override; -private: void updateGuards() const; void heroAcceptsCreatures(const CGHeroInstance *h) const; + +public: + template void serialize(Handler &h, const int version) + { + h & static_cast(*this) & creatures; + } }; class DLL_LINKAGE CGTownBuilding : public IObjectInterface diff --git a/lib/mapObjects/MiscObjects.h b/lib/mapObjects/MiscObjects.h index 77a36e04d..bff8630c4 100644 --- a/lib/mapObjects/MiscObjects.h +++ b/lib/mapObjects/MiscObjects.h @@ -227,7 +227,8 @@ class DLL_LINKAGE CGMine : public CArmedInstance public: Res::ERes producedResource; ui32 producedQuantity; - + +private: void onHeroVisit(const CGHeroInstance * h) const override; void battleFinished(const CGHeroInstance *hero, const BattleResult &result) const override; void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override; @@ -239,6 +240,7 @@ public: std::string getObjectName() const override; std::string getHoverText(PlayerColor player) const override; +public: template void serialize(Handler &h, const int version) { h & static_cast(*this);