diff --git a/lib/serializer/BinaryDeserializer.h b/lib/serializer/BinaryDeserializer.h index edcbb634f..136d95db1 100644 --- a/lib/serializer/BinaryDeserializer.h +++ b/lib/serializer/BinaryDeserializer.h @@ -235,25 +235,6 @@ public: return; } - loadPointerImpl(data); - } - - template < typename T, typename std::enable_if_t < std::is_base_of_v>, int > = 0 > - void loadPointerImpl(T &data) - { - using DataType = std::remove_pointer_t; - - typename DataType::IdentifierType index; - load(index); - - auto * constEntity = index.toEntity(VLC); - auto * constData = dynamic_cast(constEntity); - data = const_cast(constData); - } - - template < typename T, typename std::enable_if_t < !std::is_base_of_v>, int > = 0 > - void loadPointerImpl(T &data) - { if(reader->smartVectorMembersSerialization) { typedef typename std::remove_const_t> TObjectType; //eg: const CGHeroInstance * => CGHeroInstance diff --git a/lib/serializer/BinarySerializer.h b/lib/serializer/BinarySerializer.h index 71d985de9..851d53836 100644 --- a/lib/serializer/BinarySerializer.h +++ b/lib/serializer/BinarySerializer.h @@ -186,19 +186,6 @@ public: if(data == nullptr) return; - savePointerImpl(data); - } - - template < typename T, typename std::enable_if_t < std::is_base_of_v>, int > = 0 > - void savePointerImpl(const T &data) - { - auto index = data->getId(); - save(index); - } - - template < typename T, typename std::enable_if_t < !std::is_base_of_v>, int > = 0 > - void savePointerImpl(const T &data) - { typedef typename std::remove_const_t> TObjectType; if(writer->smartVectorMembersSerialization)