aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Cache/CharacterCache.h
diff options
context:
space:
mode:
authorUjp8LfXBJ6wCPR <github@lillecarl.com>2020-02-08 20:29:18 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-21 15:21:39 +0100
commit91a0fbbd7145d6fb966231689c369d641da06f9b (patch)
treef7ca752f52b78b37fa98ad73725b123b4ca42908 /src/server/game/Cache/CharacterCache.h
parent94a79bac7a06aa0f931e9d651928de7eea0a8b5c (diff)
Use boost::optional and boost::none instead of smelly pointer (#24134)
* Remove bad pointer usage from CharacterCache Use TrinityCore Option type instead which is intended for this purpose. (Wrapper around boost::option until C++17 bump is finalised) * Unify codestyle regarding TC optional type Based upon advice from @Shauren (cherry picked from commit 76831f1f467efe4aa26a38dc58c9eab2229bce71)
Diffstat (limited to 'src/server/game/Cache/CharacterCache.h')
-rw-r--r--src/server/game/Cache/CharacterCache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Cache/CharacterCache.h b/src/server/game/Cache/CharacterCache.h
index a9a872da837..74feef11e35 100644
--- a/src/server/game/Cache/CharacterCache.h
+++ b/src/server/game/Cache/CharacterCache.h
@@ -20,6 +20,7 @@
#include "Define.h"
#include "ObjectGuid.h"
+#include "Optional.h"
#include <string>
struct CharacterCacheEntry
@@ -47,7 +48,7 @@ class TC_GAME_API CharacterCache
void AddCharacterCacheEntry(ObjectGuid const& guid, uint32 accountId, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level, bool isDeleted);
void DeleteCharacterCacheEntry(ObjectGuid const& guid, std::string const& name);
- void UpdateCharacterData(ObjectGuid const& guid, std::string const& name, uint8* gender = nullptr, uint8* race = nullptr);
+ void UpdateCharacterData(ObjectGuid const& guid, std::string const& name, Optional<uint8> gender = {}, Optional<uint8> race = {});
void UpdateCharacterGender(ObjectGuid const& guid, uint8 gender);
void UpdateCharacterLevel(ObjectGuid const& guid, uint8 level);
void UpdateCharacterAccountId(ObjectGuid const& guid, uint32 accountId);