From a2c0dd11307120470a7c4ca4915f7741729e8e01 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 7 Feb 2021 11:20:11 +0100 Subject: Various small fixes * Save the fakeplayer's wielded item in set_wielded_item * pipeworks.luaentity: Return the found objects in get_objects_inside_radius * Remove the invalid and unused on_blast return values in lua_tube.lua This should avoid a crash when a strong explosion happens next to a Lua Tube. * Do not access a global "nodename" in a BUG message. This avoids a potential crash, in case the message actually appears in practice. * Set the Flow Sensor and Fountain Head mesecons connection rules * pipeworks.luaentity: Use the same function for move_to and set_pos * (no functional change) Do not save the object returned by tube_inject_item into the "item1" local variable in filter-injector.lua --- common.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common.lua') diff --git a/common.lua b/common.lua index 120a32f..207b728 100644 --- a/common.lua +++ b/common.lua @@ -223,7 +223,7 @@ function pipeworks.create_fake_player(def, is_dynamic) return self._inventory:set_stack(def.wield_list, self._wield_index, item) end - _wielded_item = ItemStack(item) + self._wielded_item = ItemStack(item) end, get_wielded_item = function(self, item) if self._inventory and def.wield_list then @@ -242,17 +242,18 @@ function pipeworks.create_fake_player(def, is_dynamic) set_bone_position = delay(), hud_change = delay(), } - local _trash -- Getter & setter functions p.get_inventory_formspec, p.set_inventory_formspec = get_set_wrap("formspec", is_dynamic) p.get_breath, p.set_breath = get_set_wrap("breath", is_dynamic) p.get_hp, p.set_hp = get_set_wrap("hp", is_dynamic) p.get_pos, p.set_pos = get_set_wrap("pos", is_dynamic) - _trash, p.move_to = get_set_wrap("pos", is_dynamic) p.get_wield_index, p.set_wield_index = get_set_wrap("wield_index", true) p.get_properties, p.set_properties = get_set_wrap("properties", false) + -- For players, move_to and get_pos do the same + p.move_to = p.get_pos + -- Backwards compatibilty p.getpos = p.get_pos p.setpos = p.set_pos -- cgit v1.2.3