Skip to content

Commit

Permalink
Fix module error in BG
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiatra committed Feb 9, 2024
1 parent f775e6f commit a0ee454
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions modules/PlayedTime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ local function getPlayerIdentifier()
if not name or not server then
name, server = UnitFullName("player")
end

name = name or ""
server = server or ""
return string.format("%s-%s", name, server)
end

Expand Down
10 changes: 7 additions & 3 deletions modules/PlayerCoordinates/PlayerCoordinates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local volumeText = "Coordinates"


local Module = ChocolateBar:NewModule(addonName, {
description = "Shows player coordinates",
description = L["Shows player coordinates"],
defaults = {
enabled = true,
},
Expand All @@ -39,8 +39,12 @@ function Module:EnableModule()
local map = C_Map.GetBestMapForUnit("player")
if map then
local position = C_Map.GetPlayerMapPosition(map, "player")
local x, y = position:GetXY()
dataobj.text = string.format("Player: %.1f X, %.1f Y", x * 100, y * 100)
if position then
local x, y = position:GetXY()
dataobj.text = string.format("Player: %.1f X, %.1f Y", x * 100, y * 100)
else
dataobj.text = "Player: Instance"
end
else
dataobj.text = "Player: Instance"
end
Expand Down

0 comments on commit a0ee454

Please sign in to comment.