Merge pull request #748 from argonui/delete-action

Delete action update
This commit is contained in:
dscarpac 2024-07-04 17:26:13 -05:00 committed by GitHub
commit cb83e9692a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 player.admin == false then
if action == Player.Action.Delete and not player.admin then
for _, target in ipairs(targets) do
local matColor = playermatApi.getMatColorByPosition(target.getPosition())
local trash = guidReferenceApi.getObjectByOwnerAndType(matColor, "Trash")