diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-04-07 00:26:23 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-04-07 00:26:23 +0200 |
commit | 422d5216679f53f454218f052786816163c395eb (patch) | |
tree | 124043ca8c7258bda5318eeeacfbea350616dee5 /src | |
parent | 7b310802583a96dd32841bc396a119fca833e2d4 (diff) |
Core/Objects: Fixed ObjectGuid equality operator for GCC 10 (completely broken, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Object/ObjectGuid.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h index b24fb1e7707..5affc9b0255 100644 --- a/src/server/game/Entities/Object/ObjectGuid.h +++ b/src/server/game/Entities/Object/ObjectGuid.h @@ -20,6 +20,7 @@ #include "Define.h" #include "EnumFlag.h" +#include <array> #include <functional> #include <list> #include <set> @@ -267,13 +268,13 @@ class TC_GAME_API ObjectGuid using LowType = uint64; - ObjectGuid() { Clear(); } + ObjectGuid() = default; uint64 GetRawValue(std::size_t i) const { return _data[i]; } std::vector<uint8> GetRawValue() const; void SetRawValue(std::vector<uint8> const& guid); void SetRawValue(uint64 high, uint64 low) { _data[0] = low; _data[1] = high; } - void Clear() { std::fill(std::begin(_data), std::end(_data), UI64LIT(0)); } + void Clear() { _data = { }; } HighGuid GetHigh() const { return HighGuid((_data[1] >> 58) & 0x3F); } uint32 GetRealmId() const { return uint32((_data[1] >> 42) & 0xFFFF); } @@ -373,7 +374,7 @@ class TC_GAME_API ObjectGuid _data[1] = high; } - uint64 _data[2]; + std::array<uint64, 2> _data = { }; }; #pragma pack(pop) |