Fall back to the map name when the display name is equal or set empty #3861
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.
Identify the Bug or Feature request
Fixes #3857
Description of the Change
Now that player aliases can internally be
null
(e.g., when upgrading a campaign, or when the user sets the display name to the same as the regular name), a few macro functions started returningnull
or generating NPEs. These functions now fallback to the map name when a player alias is not set:getMapDisplayName()
getMapName()
getAllMapDisplayNames()
getVisibleMapDisplayNames()
getInfo("map")
The loading banner will also now show the map name rather than
'null'
if no player alias is set.The new method
Zone.getDisplayName()
is used to consistently get the player-visible name of a map, whether that is the player alias or the map name.Possible Drawbacks
Should be none
Documentation Notes
None (restores 1.12.2 behaviour)
Release Notes
N/A
This change is