From f665f430fc94165a8c2d01f7d09fc327eee66c58 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Wed, 11 Jan 2017 08:02:40 -0700 Subject: fix bug in player-movement code, and also turn controller tints into a texture for easier modding by end users --- node_controllers.lua | 24 ++++++++++++------------ textures/digtron_auto_control_tint.png | Bin 0 -> 185 bytes textures/digtron_pusher_tint.png | Bin 0 -> 185 bytes util_execute_cycle.lua | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 textures/digtron_auto_control_tint.png create mode 100644 textures/digtron_pusher_tint.png diff --git a/node_controllers.lua b/node_controllers.lua index 50c6a4e..85d2550 100644 --- a/node_controllers.lua +++ b/node_controllers.lua @@ -128,12 +128,12 @@ minetest.register_node("digtron:auto_controller", { is_ground_content = false, -- Aims in the +Z direction by default tiles = { - "digtron_plate.png^[transformR90^[colorize:#88000030", - "digtron_plate.png^[transformR270^[colorize:#88000030", - "digtron_plate.png^[colorize:#88000030", - "digtron_plate.png^[transformR180^[colorize:#88000030", - "digtron_plate.png^[colorize:#88000030", - "digtron_plate.png^digtron_control.png^[colorize:#88000030", + "digtron_plate.png^[transformR90^digtron_auto_control_tint.png", + "digtron_plate.png^[transformR270^digtron_auto_control_tint.png", + "digtron_plate.png^digtron_auto_control_tint.png", + "digtron_plate.png^[transformR180^digtron_auto_control_tint.png", + "digtron_plate.png^digtron_auto_control_tint.png", + "digtron_plate.png^digtron_control.png^digtron_auto_control_tint.png", }, drawtype = "nodebox", @@ -201,12 +201,12 @@ minetest.register_node("digtron:pusher", { is_ground_content = false, -- Aims in the +Z direction by default tiles = { - "digtron_plate.png^[transformR90^[colorize:#00880030", - "digtron_plate.png^[transformR270^[colorize:#00880030", - "digtron_plate.png^[colorize:#00880030", - "digtron_plate.png^[transformR180^[colorize:#00880030", - "digtron_plate.png^[colorize:#00880030", - "digtron_plate.png^digtron_control.png^[colorize:#00880030", + "digtron_plate.png^[transformR90^digtron_pusher_tint.png", + "digtron_plate.png^[transformR270^digtron_pusher_tint.png", + "digtron_plate.png^digtron_pusher_tint.png", + "digtron_plate.png^[transformR180^digtron_pusher_tint.png", + "digtron_plate.png^digtron_pusher_tint.png", + "digtron_plate.png^digtron_control.png^digtron_pusher_tint.png", }, drawtype = "nodebox", diff --git a/textures/digtron_auto_control_tint.png b/textures/digtron_auto_control_tint.png new file mode 100644 index 0000000..0581f23 Binary files /dev/null and b/textures/digtron_auto_control_tint.png differ diff --git a/textures/digtron_pusher_tint.png b/textures/digtron_pusher_tint.png new file mode 100644 index 0000000..a4c12c8 Binary files /dev/null and b/textures/digtron_pusher_tint.png differ diff --git a/util_execute_cycle.lua b/util_execute_cycle.lua index 080c0ae..4199782 100644 --- a/util_execute_cycle.lua +++ b/util_execute_cycle.lua @@ -247,7 +247,7 @@ digtron.execute_dig_cycle = function(pos, clicker) pos = digtron.find_new_pos(pos, facing) meta = minetest.get_meta(pos) if move_player then - clicker:moveto(digtron.find_new_pos(player_pos, facing), true) + clicker:moveto(digtron.find_new_pos(clicker:getpos(), facing), true) end local building_fuel_cost = 0 @@ -359,7 +359,7 @@ digtron.execute_move_cycle = function(pos, clicker) local oldpos = {x=pos.x, y=pos.y, z=pos.z} pos = digtron.find_new_pos(pos, facing) if move_player then - clicker:moveto(digtron.find_new_pos(player_pos, facing), true) + clicker:moveto(digtron.find_new_pos(clicker:getpos(), facing), true) end return pos, "", 0 -- cgit v1.2.3