diff --git a/lib/mapObjects/MiscObjects.h b/lib/mapObjects/MiscObjects.h index f159f418d..b0efd00cc 100644 --- a/lib/mapObjects/MiscObjects.h +++ b/lib/mapObjects/MiscObjects.h @@ -196,6 +196,8 @@ public: GameResID producedResource; ui32 producedQuantity; std::set abandonedMineResources; + + bool isAbandoned() const; private: void onHeroVisit(const CGHeroInstance * h) const override; @@ -209,7 +211,6 @@ private: std::string getObjectName() const override; std::string getHoverText(PlayerColor player) const override; - bool isAbandoned() const; public: template void serialize(Handler &h, const int version) { diff --git a/mapeditor/inspector/inspector.cpp b/mapeditor/inspector/inspector.cpp index eb61e66b8..a4742b054 100644 --- a/mapeditor/inspector/inspector.cpp +++ b/mapeditor/inspector/inspector.cpp @@ -184,8 +184,16 @@ void Initializer::initialize(CGMine * o) if(!o) return; o->tempOwner = defaultPlayer; - o->producedResource = GameResID(o->subID); - o->producedQuantity = o->defaultResProduction(); + if(o->isAbandoned()) + { + for(auto r = GameResID(0); r < GameResID::COUNT; ++r) + o->abandonedMineResources.insert(r); + } + else + { + o->producedResource = GameResID(o->subID); + o->producedQuantity = o->defaultResProduction(); + } } void Initializer::initialize(CGResource * o)