From c679cf919ec58310db9399bf5b90632fb0374b1d Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 5 Jul 2024 00:22:28 +0200 Subject: [PATCH] update delete action --- src/core/Global.ttslua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index d899832b..fc4bf93c 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -253,8 +253,9 @@ function onPlayerConnect() Wait.time(function() playermatApi.redrawSlotSymbols("All") end, 0.2) end +-- disable delete action (only applies to promoted players) and discard objects instead function onPlayerAction(player, action, targets) - if action == Player.Action.Delete and not player.admin then + if action == Player.Action.Delete and player.admin ~= true then for _, target in ipairs(targets) do local matColor = playermatApi.getMatColorByPosition(target.getPosition()) local trash = guidReferenceApi.getObjectByOwnerAndType(matColor, "Trash")