From c9cd3f70a18e153c7df9131a2f428cc3f5c94f5b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 3 Jan 2023 22:17:27 +0100 Subject: [PATCH] change collision condition --- src/core/PlayArea.ttslua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 644763f3..3da4afec 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -26,7 +26,6 @@ local SHIFT_EXCLUSION = { local tokenManager = require("core/token/TokenManager") local INVESTIGATOR_COUNTER_GUID = "f182ee" local PLAY_AREA_ZONE_GUID = "a2f932" -local lastCollisionObject local currentScenario --------------------------------------------------------- @@ -64,12 +63,10 @@ end function onCollisionEnter(collision_info) local obj = collision_info.collision_object - - -- only trigger the following once every 0.1s for each object - -- (otherwise TTS fires this event 20 times and that causes 20 JSON decodes) - if not COLLISION_ENABLED or lastCollisionObject == obj then return end - lastCollisionObject = obj - Wait.time(function() lastCollisionObject = nil end, 0.1) + local objType = obj.name + + -- only continue for cards + if not COLLISION_ENABLED or (objType ~= "Card" and objType ~= "CardCustom") then return end -- check if we should spawn clues here and do so according to playercount if shouldSpawnTokens(obj) then