1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fix CGBonusingObject serialization

Now state of adventure map objects that use this handler will be saved properly and they'll work as indended after save loaded. Affect following objects: Buoy, Swan Pond, Faerie Ring, etc.
This commit is contained in:
ArseniyShestakov 2014-12-22 11:56:53 +03:00
parent da76a2f227
commit 5d59bbc0d4
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@
#include "mapping/CCampaignHandler.h" //for CCampaignState
#include "rmg/CMapGenerator.h" // for CMapGenOptions
const ui32 version = 750;
const ui32 version = 751;
const ui32 minSupportedVersion = version;
class CConnection;

View File

@ -269,7 +269,7 @@ public:
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CGObjectInstance&>(*this);
h & static_cast<CRewardableObject&>(*this);
}
};

View File

@ -38,7 +38,6 @@ void registerTypesMapObjects1(Serializer &s)
s.template registerType<CGObjectInstance, CGTeleport>();
s.template registerType<CGObjectInstance, CGSignBottle>();
s.template registerType<CGObjectInstance, CGScholar>();
s.template registerType<CGObjectInstance, CGBonusingObject>();
s.template registerType<CGObjectInstance, CGMagicWell>();
s.template registerType<CGObjectInstance, CGObservatory>();
s.template registerType<CGObjectInstance, CGKeys>();
@ -142,6 +141,7 @@ void registerTypesMapObjects2(Serializer &s)
s.template registerType<CGObjectInstance, CRewardableObject>();
s.template registerType<CRewardableObject, CGPickable>();
s.template registerType<CRewardableObject, CGBonusingObject>();
s.template registerType<CRewardableObject, CGVisitableOPH>();
s.template registerType<CRewardableObject, CGVisitableOPW>();
s.template registerType<CRewardableObject, CGOnceVisitable>();