fix(Core/Player): prevent null pointer dereference in SendLoot function (#23965)

Co-authored-by: Roman BADANIN <r.badanin@defi-informatique.fr>
This commit is contained in:
Localhost
2025-12-06 08:13:46 +01:00
committed by GitHub
parent 8d31bcec9a
commit 5dc2382805

View File

@@ -7894,7 +7894,9 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
// And permit out of range GO with no owner in case fishing hole
if (!go || (loot_type != LOOT_FISHINGHOLE && ((loot_type != LOOT_FISHING && loot_type != LOOT_FISHING_JUNK) || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault()))
{
if (go)
go->ForceValuesUpdateAtIndex(GAMEOBJECT_BYTES_1);
SendLootRelease(guid);
return;
}