Merge pull request #144 from argonui/handhelper-fix
Hand Helper: Fix playmat api connection
This commit is contained in:
commit
405033af79
@ -153,6 +153,7 @@ end
|
||||
---------------------------------------------------------
|
||||
-- discards a random card from hand
|
||||
---------------------------------------------------------
|
||||
|
||||
function discardRandom()
|
||||
if not playerExists(playerColor) then return end
|
||||
|
||||
@ -162,10 +163,8 @@ function discardRandom()
|
||||
broadcastToAll("Cannot discard from empty hand!", "Red")
|
||||
else
|
||||
local searchPos = Player[playerColor].getHandTransform().position
|
||||
local mat = playmatAPI.getMatbyPosition(searchPos)
|
||||
if mat == nil then return end
|
||||
|
||||
local discardPos = mat.getTable("DISCARD_PILE_POSITION")
|
||||
local discardPos = playmatAPI.getDiscardPosition(playmatAPI.getMatColorByPosition(searchPos))
|
||||
if discardPos == nil then
|
||||
broadcastToAll("Couldn't retrieve discard position from playermat!", "Red")
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user