diff --git a/src/accessories/PlayermatHider.ttslua b/src/accessories/PlayermatHider.ttslua index 80e7cdc2..42e7532c 100644 --- a/src/accessories/PlayermatHider.ttslua +++ b/src/accessories/PlayermatHider.ttslua @@ -1,10 +1,9 @@ local guidReferenceApi = require("core/GUIDReferenceApi") local playmatApi = require("playermat/PlaymatApi") -local objects function onClick_hideShow(player, matColor) - objects = guidReferenceApi.getObjectsByOwner(matColor) - local actionTokens = playmatApi.searchAroundPlaymat(matColor, isActionToken) + local objects = guidReferenceApi.getObjectsByOwner(matColor) + local actionTokens = playmatApi.searchAroundPlaymat(matColor, "isActionToken") local pos = objects.Playermat.getPosition() local mod = (pos.y > 0) and -2 or 2 diff --git a/src/playercards/cards/FamilyInheritance.ttslua b/src/playercards/cards/FamilyInheritance.ttslua index 7b2be65f..e66b4b8e 100644 --- a/src/playercards/cards/FamilyInheritance.ttslua +++ b/src/playercards/cards/FamilyInheritance.ttslua @@ -15,7 +15,7 @@ function searchSelf() clickableResourceCounter = nil foundTokens = 0 - for _, obj in ipairs(searchLib.onObject(self)) do + for _, obj in ipairs(searchLib.onObject(self), "isTileOrToken") do local image = obj.getCustomObject().image if image == "http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/" then foundTokens = foundTokens + math.abs(obj.getQuantity()) diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index a405d589..8ac011e9 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -199,7 +199,7 @@ do -- finds all objects on the playmat and associated set aside zone and returns a table ---@param matColor String Color of the playmat - White, Orange, Green, Red or All - ---@param filter Function Optional filter function (return true for desired objects) + ---@param filter String Name of the filte function (see util/SearchLib) PlaymatApi.searchAroundPlaymat = function(matColor, filter) local objList = {} for _, mat in pairs(getMatForColor(matColor)) do diff --git a/src/util/SearchLib.ttslua b/src/util/SearchLib.ttslua index 6bc1ffa2..444c463e 100644 --- a/src/util/SearchLib.ttslua +++ b/src/util/SearchLib.ttslua @@ -24,8 +24,7 @@ do orientation = rot or { 0, 0, 0 }, type = 3, size = size, - max_distance = maxDistance or 0, - debug = true + max_distance = maxDistance or 0 }) -- filtering the result