Skip to content

Commit 2e6bee2

Browse files
gonzo1247Ovahlord
andauthored
Core/Objects: fixed buffer initialization of PackedGuid (#462)
* Core/ObjectGuid: Properly initialize PackedGuid buffer * use correct initializer for buffer initialization * correct array initialization in PackedGuid constructors --------- Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
1 parent e7a5230 commit 2e6bee2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/server/game/Entities/Object/ObjectGuid.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ ObjectGuid ObjectGuid::MapSpecific(HighGuid type, uint32 entry, LowType counter)
8686
void PackedGuid::Set(ObjectGuid guid)
8787
{
8888
_packedSize = 1;
89+
_packedGuid = { };
8990
uint64 raw = guid.GetRawValue();
9091
for (uint8 i = 0; i < 8; ++i)
9192
{

src/server/game/Entities/Object/ObjectGuid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ class TC_GAME_API PackedGuid
299299
friend TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, PackedGuid const& guid);
300300

301301
public:
302-
explicit PackedGuid() : _packedSize(1), _packedGuid() { }
303-
explicit PackedGuid(ObjectGuid guid) { Set(guid); }
302+
explicit PackedGuid() : _packedSize(1), _packedGuid({}) { }
303+
explicit PackedGuid(ObjectGuid guid) : _packedSize(1), _packedGuid({}) { Set(guid); }
304304

305305
void Set(ObjectGuid guid);
306306

0 commit comments

Comments
 (0)