From 4ee3ef55dd3d6a27eb4f39a831dd6e5d779ae115 Mon Sep 17 00:00:00 2001 From: tacigar Date: Sat, 7 Jan 2017 17:38:49 +0900 Subject: [PATCH] Update on_step --- maidroid/api.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maidroid/api.lua b/maidroid/api.lua index 1c294cc..93e9250 100644 --- a/maidroid/api.lua +++ b/maidroid/api.lua @@ -517,6 +517,11 @@ function maidroid.register_maidroid(product_name, def) -- on_step is a callback function that is called every delta times. local function on_step(self, dtime) + -- if owner didn't login, the maidroid does nothing. + if not minetest.get_player_by_name(self.owner_name) then + return + end + -- pickup surrounding item. pickup_item(self)