mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Add save compatibility
This commit is contained in:
		| @@ -95,7 +95,17 @@ public: | ||||
| 	{ | ||||
| 		h & static_cast<CBonusSystemNode&>(*this); | ||||
| 		h & static_cast<CCombinedArtifactInstance&>(*this); | ||||
| 		h & artTypeID; | ||||
| 		if (h.version >= Handler::Version::REMOVE_VLC_POINTERS) | ||||
| 		{ | ||||
| 			h & artTypeID; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			bool isNull = false; | ||||
| 			h & isNull; | ||||
| 			if (!isNull) | ||||
| 				h & artTypeID; | ||||
| 		} | ||||
| 		h & id; | ||||
| 		BONUS_TREE_DESERIALIZATION_FIX | ||||
| 	} | ||||
|   | ||||
| @@ -138,15 +138,50 @@ struct DLL_LINKAGE TerrainTile | ||||
| 	template <typename Handler> | ||||
| 	void serialize(Handler & h) | ||||
| 	{ | ||||
| 		if (h.version >= Handler::Version::REMOVE_VLC_POINTERS) | ||||
| 		{ | ||||
| 			h & terrainType; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			bool isNull = false; | ||||
| 			h & isNull; | ||||
| 			if (isNull) | ||||
| 				h & terrainType; | ||||
| 		} | ||||
| 		h & terrainType; | ||||
| 		h & terView; | ||||
| 		h & riverType; | ||||
| 		if (h.version >= Handler::Version::REMOVE_VLC_POINTERS) | ||||
| 		{ | ||||
| 			h & riverType; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			bool isNull = false; | ||||
| 			h & isNull; | ||||
| 			if (isNull) | ||||
| 				h & riverType; | ||||
| 		} | ||||
| 		h & riverDir; | ||||
| 		h & roadType; | ||||
| 		if (h.version >= Handler::Version::REMOVE_VLC_POINTERS) | ||||
| 		{ | ||||
| 			h & roadType; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			bool isNull = false; | ||||
| 			h & isNull; | ||||
| 			if (isNull) | ||||
| 				h & roadType; | ||||
| 		} | ||||
| 		h & roadDir; | ||||
| 		h & extTileFlags; | ||||
| 	//	h & visitable; | ||||
| 	//	h & blocked; | ||||
| 		if (h.version < Handler::Version::REMOVE_VLC_POINTERS) | ||||
| 		{ | ||||
| 			bool unused; | ||||
| 			h & unused; | ||||
| 			h & unused; | ||||
| 		} | ||||
| 		h & visitableObjects; | ||||
| 		h & blockingObjects; | ||||
| 	} | ||||
|   | ||||
| @@ -65,6 +65,7 @@ enum class ESerializationVersion : int32_t | ||||
| 	LOCAL_PLAYER_STATE_DATA, // 866 - player state contains arbitrary client-side data | ||||
| 	REMOVE_TOWN_PTR, // 867 - removed pointer to CTown from CGTownInstance | ||||
| 	REMOVE_OBJECT_TYPENAME, // 868 - remove typename from CGObjectInstance | ||||
| 	REMOVE_VLC_POINTERS, // 869 removed remaining pointers to VLC entities | ||||
|  | ||||
| 	CURRENT = REMOVE_OBJECT_TYPENAME | ||||
| 	CURRENT = REMOVE_VLC_POINTERS | ||||
| }; | ||||
|   | ||||
| @@ -2912,7 +2912,7 @@ bool CGameHandler::assembleArtifacts(ObjectInstanceID heroID, ArtifactPosition a | ||||
|  | ||||
| 		AssembledArtifact aa; | ||||
| 		aa.al = dstLoc; | ||||
| 		aa.artId = assembleTo->getId(); | ||||
| 		aa.artId = assembleTo; | ||||
| 		sendAndApply(aa); | ||||
| 	} | ||||
| 	else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user