Skip to content

Core/Player: Use the saved zone when loading the inventory - #500

Merged
Ovahlord merged 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
KaputterKerl:Fix_Inventory_Zone_On_Load
Oct 16, 2026
Merged

Ovahlord merged 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
KaputterKerl:Fix_Inventory_Zone_On_Load

Conversation

@KaputterKerl

Copy link
Copy Markdown
Contributor

Core/Player: Use the saved zone when loading the inventory

Problem

Items that are limited to a zone (AreaID in ItemSparse) were deleted
on every login. For example item 46856 (Keys to the Hot Rod, AreaID
4737 Kezan) was gone after each relog, although the character was
standing in Kezan.

log showed:

Player::_LoadInventory: player (GUID: 1, name: 'Goblinn', map: 648) has item (GUID: 47, entry: 46856) limited to another map (0). Deleting item.

The value in brackets is the zone, and it was 0. _LoadInventory takes
it from GetZoneId(), which is only set once the player is placed in
the world, and that is after the inventory is loaded. So every item with
an AreaID fails the IsLimitedToAnotherMapOrZone check.

Fix

Set m_zoneId from the zone column of the characters table before
_LoadInventory. The zone is updated again when the player is added to
the map.

Items limited to a zone (AreaID) were deleted on login, because the zone
was still 0 while the inventory is loaded.
@Ovahlord

Copy link
Copy Markdown
Member

Will test and merge later when I find the time

@Ovahlord
Ovahlord merged commit b86ebed into The-Cataclysm-Preservation-Project:master Oct 16, 2026
@KaputterKerl
KaputterKerl deleted the Fix_Inventory_Zone_On_Load branch October 18, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants