added Wendy Menu edge case handling

This commit is contained in:
Chr1Z93 2024-01-10 23:56:51 +01:00
parent 640c0dd8a2
commit ce2a31c510

View File

@ -268,9 +268,13 @@ end
function addMenuOptions(parameters)
local playerColor = parameters.playerColor
local hoveredObject = parameters.hoveredObject
if hoveredObject == nil or hoveredObject.getVar("MENU_ADDED") == true then return end
if hoveredObject.tag ~= "Card" then
broadcastToColor("Right-click seal options can only be added to cards", playerColor)
if hoveredObject == nil then
return
elseif hoveredObject.type ~= "Card" then
broadcastToColor("Right-click seal options can only be added to cards.", playerColor)
return
elseif hoveredObject.hasTag("CardThatSeals") or hoveredObject.getVar("MENU_ADDED") == true then
broadcastToColor("This card already has a sealing context menu.", playerColor)
return
end