Compare commits

..

2 Commits

Author SHA1 Message Date
loosewheel
ec08eebfd3 Add files via upload 2021-11-25 07:15:45 +10:00
loosewheel
cf8c44cb80 Add files via upload 2021-11-25 07:06:57 +10:00
6 changed files with 36 additions and 3 deletions

View File

@@ -138,9 +138,9 @@ local function can_break_node (pos, breakpos)
if node_def then if node_def then
-- try tool first -- try tool first
local tool = get_tool (pos) local tool = get_tool (pos)
local dig_params = nil
if tool then if tool then
local dig_params = nil
local tool_def = minetest.registered_items[tool:get_name ()] local tool_def = minetest.registered_items[tool:get_name ()]
if tool_def then if tool_def then

View File

@@ -180,6 +180,25 @@ end
local function aim_barrel_delayed (pos, aimpos)
local x = tonumber (aimpos.x) or 0
local y = tonumber (aimpos.y) or 0
local z = tonumber (aimpos.z) or 0
if z < 1 then
return
end
local angle = vector.dir_to_rotation (aimpos)
local rot = math.floor (math.deg (-angle.y) + 0.5)
local pitch = math.floor (math.deg (angle.x) + 0.5)
set_barrel_angle_delayed (pos, pitch, rot)
end
local function fire_cannon (pos) local function fire_cannon (pos)
local meta = minetest.get_meta (pos) local meta = minetest.get_meta (pos)
@@ -764,6 +783,12 @@ local function digilines_support ()
msg.pitch and msg.yaw and msg.name and msg.look_vector then msg.pitch and msg.yaw and msg.name and msg.look_vector then
process_controller_input (pos, msg) process_controller_input (pos, msg)
elseif type (msg.action) == "string" and msg.action == "aim" and
type (msg.aim) == "table" then
aim_barrel_delayed (pos, msg.aim)
end end
end end

View File

@@ -62,3 +62,8 @@ v0.1.9
v0.1.10 v0.1.10
* Added cannons. * Added cannons.
v0.1.11
* Fix to breakers (?).
* Added position aiming to cannons.

View File

@@ -1,4 +1,4 @@
local version = "0.1.10" local version = "0.1.11"
local mod_storage = minetest.get_mod_storage () local mod_storage = minetest.get_mod_storage ()

View File

@@ -95,6 +95,7 @@ minetest.register_node ("lwcomponents:player_button", {
"lwplayer_button_side.png", "lwplayer_button_side.png",
"lwplayer_button.png" "lwplayer_button.png"
}, },
use_texture_alpha = "clip",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
legacy_wallmounted = true, legacy_wallmounted = true,
@@ -143,6 +144,7 @@ minetest.register_node ("lwcomponents:player_button_off", {
"lwplayer_button_side.png", "lwplayer_button_side.png",
"lwplayer_button.png" "lwplayer_button.png"
}, },
use_texture_alpha = "clip",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
legacy_wallmounted = true, legacy_wallmounted = true,
@@ -192,6 +194,7 @@ minetest.register_node ("lwcomponents:player_button_on", {
"lwplayer_button_side.png", "lwplayer_button_side.png",
"lwplayer_button_on.png" "lwplayer_button_on.png"
}, },
use_texture_alpha = "clip",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
legacy_wallmounted = true, legacy_wallmounted = true,

View File

@@ -13,7 +13,7 @@ CC BY-SA 3.0
Version Version
======= =======
0.1.10 0.1.11
Minetest Version Minetest Version