diff --git a/nel/include/nel/misc/deep_ptr.h b/nel/include/nel/misc/deep_ptr.h index f0b5b1f79..087b1d84b 100644 --- a/nel/include/nel/misc/deep_ptr.h +++ b/nel/include/nel/misc/deep_ptr.h @@ -46,9 +46,17 @@ public: NL_FORCE_INLINE bool operator==(const T *p) const { return (m == p) || (m && p && *m == *p); } NL_FORCE_INLINE bool operator!=(const T *p) const { return !(*this == p); } + NL_FORCE_INLINE bool operator==(long int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == NULL + NL_FORCE_INLINE bool operator!=(long int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != NULL + NL_FORCE_INLINE bool operator==(int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == 0 NL_FORCE_INLINE bool operator!=(int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != 0 +#ifdef NL_CPP14 + NL_FORCE_INLINE bool operator==(nullptr_t p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == nullptr + NL_FORCE_INLINE bool operator!=(nullptr_t p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != nullptr +#endif + NL_FORCE_INLINE T &operator*() { return *m; } NL_FORCE_INLINE const T &operator*() const { return *m; } NL_FORCE_INLINE T *operator->() { return m; } diff --git a/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp b/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp index 540ef8c46..a6dbdfe7f 100644 --- a/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp +++ b/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp @@ -1343,9 +1343,9 @@ private: PROP2(_HP, uint32, _HP, _HP=val)\ PROP2(_Recommended, uint32, _Recommended, _Recommended=val)\ PROP2(_CreatorId, CEntityId, _CreatorId, _CreatorId=val)\ - PROP2(_PhraseId, string, getPhraseId(), setPhraseId(val))\ - LPROP2(_PhraseLiteral, bool, if (_PhraseLiteral), _PhraseLiteral, _PhraseLiteral=val)\ - LSTRUCT2(_CraftParameters, if (_CraftParameters != NULL), _CraftParameters->store(pdr), _CraftParameters = new CItemCraftParameters; _CraftParameters->apply(pdr))\ + PROP2(_PhraseId, string, getPhraseId(), setPhraseId(val))\ + LPROP2(_PhraseLiteral, bool, if (_PhraseLiteral), _PhraseLiteral, _PhraseLiteral=val)\ + LSTRUCT2(_CraftParameters, if (_CraftParameters), _CraftParameters->store(pdr), _CraftParameters = new CItemCraftParameters; _CraftParameters->apply(pdr))\ LPROP2(_SlotImage, uint16, if (0), 0xffff, slotImage=val) /* Very old version compatibility */ \ LPROP2(_SapLoad, uint32, if (_SapLoad!=0), _SapLoad, _SapLoad=val)\ LPROP2(_Dropable, bool, if (!_Dropable), _Dropable, _Dropable=val)\