From d6015974a6068f6426c2183a10d938cd61907a5b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Wed, 18 Oct 2023 21:48:58 +0200 Subject: [PATCH] added error catching --- src/playermat/Playmat.ttslua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index 63f9c5e7..29d8381f 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -272,7 +272,8 @@ function placeOrMergeIntoDeck(obj, pos, rot) obj.use_hands = true -- this avoids a TTS bug that merges unrelated cards that are not resting if #searchResult == 1 then - searchResult[1].putObject(obj) + -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put) + pcall(function() searchResult[1].putObject(obj) end) end end, function() return not obj.isSmoothMoving() end, 3)