Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: house transfer item to owner #3258

Merged
merged 2 commits into from
Jan 25, 2025

Conversation

dudantas
Copy link
Member

Description

This PR fixes an issue with the house item transfer system during server startup. Specifically, the getPlayerByGUID function was not passing true to retrieve offline players, which caused items belonging to offline players to be removed instead of being correctly transferred to their inbox. Additionally, the logic for handling ownership of items was improved to ensure the correct transfer of items to their respective owners, even when no players are online during server startup.

Behaviour

Actual

When transferring house items during server startup:

  • Items owned by offline players are removed instead of being transferred to their inbox.
  • The getPlayerByGUID function does not retrieve offline players because the true parameter is not passed.

Expected

When transferring house items during server startup:

  • Items owned by offline players are correctly transferred to their inbox.
  • The getPlayerByGUID function retrieves offline players by passing the true parameter.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested

The following tests were performed to verify the fix:

  • Test A: Transfer house items at server startup with offline players as item owners. Verified that items were correctly transferred to the inbox of the respective offline players.
  • Test B: Transfer house items at server startup with both online and offline players. Verified that the behavior was consistent for both scenarios.
  • Test C: Verified that items without owners or invalid owners were properly handled (e.g., removed or logged for debugging).

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@majestyotbr majestyotbr merged commit 1ff6943 into main Jan 25, 2025
34 checks passed
@majestyotbr majestyotbr deleted the dudantas/fix-house-transfer-owner-items branch January 25, 2025 19:21
vllworldbuilding pushed a commit to vllworldbuilding/canary that referenced this pull request Jan 31, 2025
This fixes an issue with the house item transfer system during server startup. Specifically, the `getPlayerByGUID` function was not passing `true` to retrieve offline players, which caused items belonging to offline players to be removed instead of being correctly transferred to their inbox. Additionally, the logic for handling ownership of items was improved to ensure the correct transfer of items to their respective owners, even when no players are online during server startup.
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