azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
101 stars 130 forks source link

Update WorldPacketMethods.h #195

Open Hi-jadewong opened 2 months ago

Hi-jadewong commented 2 months ago

The GUID is incorrect, it was read without going through the buffer.Sometings crash.

int ReadGUID(lua_State L, WorldPacket packet) { ObjectGuid guid; (*packet) >> guid; Eluna::Push(L, guid); return 1; }

The following code works correctly:

int ReadGUID(lua_State L, WorldPacket packet) { uint64 guid; packet->readPackGUID(guid); Eluna::Push(L, guid); return 1; }