diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 7c0f575d8..56fc616f6 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -1304,7 +1304,8 @@ void CGameState::prepareCrossoverHeroes(std::vectorspells.clear(); // Spellbook will also be removed - ArtifactLocation(cgh, ArtifactPosition(ArtifactPosition::SPELLBOOK)).removeArtifact(); + if (cgh->hasSpellbook()) + ArtifactLocation(cgh, ArtifactPosition(ArtifactPosition::SPELLBOOK)).removeArtifact(); } } diff --git a/lib/Connection.h b/lib/Connection.h index 3a80bb358..732312bb4 100644 --- a/lib/Connection.h +++ b/lib/Connection.h @@ -1018,7 +1018,7 @@ class DLL_LINKAGE CLoaderBase : public virtual CSerializer class CBasicPointerLoader { public: - virtual const type_info * loadPtr(CLoaderBase &ar, void *data, ui32 pid) const =0; //data is pointer to the ACTUAL POINTER + virtual const std::type_info * loadPtr(CLoaderBase &ar, void *data, ui32 pid) const =0; //data is pointer to the ACTUAL POINTER virtual ~CBasicPointerLoader(){} }; @@ -1027,7 +1027,7 @@ struct ClassObjectCreator { static T *invoke() { - static_assert(!typename std::is_abstract::value, "Cannot call new upon abstract classes!"); + static_assert(!std::is_abstract::value, "Cannot call new upon abstract classes!"); return new T(); } }; @@ -1044,7 +1044,7 @@ struct ClassObjectCreator::value> template class CPointerLoader : public CBasicPointerLoader { public: - const type_info * loadPtr(CLoaderBase &ar, void *data, ui32 pid) const //data is pointer to the ACTUAL POINTER + const std::type_info * loadPtr(CLoaderBase &ar, void *data, ui32 pid) const //data is pointer to the ACTUAL POINTER { Serializer &s = static_cast(ar); T *&ptr = *static_cast(data); @@ -1655,7 +1655,10 @@ public: void addApplier(ui16 ID) { if(!apps.count(ID)) - apps[ID] = T::getApplier(); + { + RegisteredType * rtype = nullptr; + apps[ID] = T::getApplier(rtype); + } } template