Add files via upload
This commit is contained in:
@@ -138,9 +138,9 @@ local function can_break_node (pos, breakpos)
|
||||
if node_def then
|
||||
-- try tool first
|
||||
local tool = get_tool (pos)
|
||||
local dig_params = nil
|
||||
|
||||
if tool then
|
||||
local dig_params = nil
|
||||
local tool_def = minetest.registered_items[tool:get_name ()]
|
||||
|
||||
if tool_def then
|
||||
|
25
cannon.lua
25
cannon.lua
@@ -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 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
|
||||
|
||||
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
|
||||
|
@@ -62,3 +62,8 @@ v0.1.9
|
||||
|
||||
v0.1.10
|
||||
* Added cannons.
|
||||
|
||||
|
||||
v0.1.11
|
||||
* Fix to breakers (?).
|
||||
* Added position aiming to cannons.
|
||||
|
2
init.lua
2
init.lua
@@ -1,4 +1,4 @@
|
||||
local version = "0.1.10"
|
||||
local version = "0.1.11"
|
||||
local mod_storage = minetest.get_mod_storage ()
|
||||
|
||||
|
||||
|
@@ -13,7 +13,7 @@ CC BY-SA 3.0
|
||||
|
||||
Version
|
||||
=======
|
||||
0.1.10
|
||||
0.1.11
|
||||
|
||||
|
||||
Minetest Version
|
||||
|
Reference in New Issue
Block a user