some bugfixes
This commit is contained in:
parent
198716174f
commit
abd4fc5f26
@ -285,7 +285,7 @@ function tidyPlayerMatCoroutine()
|
||||
if i < 5 then
|
||||
objList = playmatApi.searchAroundPlaymat(COLORS[i])
|
||||
else
|
||||
objList = searchLib.inArea({ -2, 2, 10 }, _, { 55, 1, 13.5 })
|
||||
objList = searchLib.inArea({ -2, 2, 10 }, { 0, 270, 0 }, { 55, 1, 13.5 })
|
||||
end
|
||||
|
||||
for _, obj in ipairs(objList) do
|
||||
|
@ -209,18 +209,13 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
||||
return
|
||||
elseif hoveredObject.type == "Card" then
|
||||
cardName = hoveredObject.getName()
|
||||
local searchResult = searchLib.onObject(hoveredObject, "isClue")
|
||||
|
||||
for _, v in ipairs(searchLib.onObject(hoveredObject)) do
|
||||
local obj = v.hit_object
|
||||
if obj.memo == "clueDoom" and obj.is_face_down == false then
|
||||
clue = obj
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if clue == nil then
|
||||
if #searchResult == 0 then
|
||||
broadcastToColor("This card does not have any clues on it.", playerColor, "Yellow")
|
||||
return
|
||||
else
|
||||
clue = searchResult[1]
|
||||
end
|
||||
elseif hoveredObject.memo == "clueDoom" then
|
||||
if hoveredObject.is_face_down then
|
||||
@ -228,11 +223,10 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
||||
return
|
||||
end
|
||||
|
||||
for _, obj in ipairs(searchLib.belowPosition(hoveredObject.getPosition(), "isCard")) do
|
||||
if obj.type == "Card" then
|
||||
cardName = obj.getName()
|
||||
break
|
||||
end
|
||||
local searchResult = searchLib.belowPosition(hoveredObject.getPosition(), "isCard")
|
||||
|
||||
if #searchResult ~= 0 then
|
||||
cardName = searchResult[1].getName()
|
||||
end
|
||||
else
|
||||
broadcastToColor("Hover a clue or card with clues and try again.", playerColor, "Yellow")
|
||||
|
@ -298,7 +298,6 @@ function doUpkeepFromHotkey(color)
|
||||
end
|
||||
|
||||
function doUpkeep(_, clickedByColor, isRightClick)
|
||||
-- right-click allow color changing
|
||||
if isRightClick then
|
||||
changeColor(clickedByColor)
|
||||
return
|
||||
|
@ -45,7 +45,7 @@ do
|
||||
-- searches the area on an object
|
||||
SearchLib.onObject = function(obj, filter)
|
||||
pos = obj.getPosition()
|
||||
size = obj.getBounds().size
|
||||
size = obj.getBounds().size:setAt("y", 1)
|
||||
return returnSearchResult(pos, _, size, filter)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user