From 3830a02c34ea1d00d0d29649003a170205e7206c Mon Sep 17 00:00:00 2001 From: kepler155c Date: Sat, 24 Nov 2018 22:14:23 -0500 Subject: [PATCH] milo: mitigate manipulator bound bug --- milo/plugins/remote.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/milo/plugins/remote.lua b/milo/plugins/remote.lua index ca8f6fa..6aeba40 100644 --- a/milo/plugins/remote.lua +++ b/milo/plugins/remote.lua @@ -11,9 +11,17 @@ local SHIELD_SLOT = 2 local context = Milo:getContext() +local function getNameSafe(v) + local name + pcall(function() + name = v.getName() + end) + return name +end + local function getManipulatorForUser(user) for _,v in pairs(device) do - if v.type == 'manipulator' and v.getName and v.getName() == user then + if v.type == 'manipulator' and v.getName and getNameSafe(v) == user then return v end end @@ -110,6 +118,7 @@ local function client(socket) slot.count) end) end + Milo:clearGrid() -- in case all items do not fit in user's inventory end) end