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
|
-- discards a random card from hand
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
function discardRandom()
|
function discardRandom()
|
||||||
if not playerExists(playerColor) then return end
|
if not playerExists(playerColor) then return end
|
||||||
|
|
||||||
@ -162,10 +163,8 @@ function discardRandom()
|
|||||||
broadcastToAll("Cannot discard from empty hand!", "Red")
|
broadcastToAll("Cannot discard from empty hand!", "Red")
|
||||||
else
|
else
|
||||||
local searchPos = Player[playerColor].getHandTransform().position
|
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
|
if discardPos == nil then
|
||||||
broadcastToAll("Couldn't retrieve discard position from playermat!", "Red")
|
broadcastToAll("Couldn't retrieve discard position from playermat!", "Red")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user