Console use guid lookup when player offline#266
Merged
billy1arm merged 1 commit intomangoszero:masterfrom Mar 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves admin console command targeting by allowing console-selected players who have since gone offline to still be resolved via a stored GUID, enabling commands that accept offline targets to work as expected.
Changes:
- Adds a GUID fallback path for console-selected players when the selected player is now offline.
- Enhances
player_nameresolution for offline console targets by looking up the name from the GUID viaObjectMgr.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When a console command is issued without a player name argument, ExtractPlayerTarget normally resolves the target via getSelectedPlayer(), which only returns online players. This change falls back to the stored console selection GUID when the selected player is offline, and looks up their name from the database if needed. This primarily benefits commands that require a player GUID or name but do not need a live Player pointer -- such as teleport or account queries. Commands that operate on a live Player object will still fail for offline targets. Impact is therefore limited to that subset of no-argument console commands.
fae136c to
73f13de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quality of life change for admin console commands that target players. If you select an offline player and use a command that targets players, it will correctly resolve them so the command works. See the commit message for more details, but that's the gist of it.
Not really an important change. Just something that annoyed me exactly ONE time, and I was ornery enough at the time to change it.
This change is