diff --git a/cannon.lua b/cannon.lua index 542cfd8..daa14b9 100644 --- a/cannon.lua +++ b/cannon.lua @@ -35,11 +35,11 @@ local register_spacecannon = function(def) entity_texture }, collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25}, - physical = false + physical = false, + static_save = false, }, timer = 0, lifetime = 0, - static_save = false, penetrated = 0, on_step = function(self, dtime) @@ -51,7 +51,7 @@ local register_spacecannon = function(def) return end - local pos = self.object:getpos() + local pos = self.object:get_pos() if self.timer > 0.5 then -- add sparks along the way diff --git a/util.lua b/util.lua index f39a8f7..2253422 100644 --- a/util.lua +++ b/util.lua @@ -117,7 +117,7 @@ spacecannon.fire = function(pos, playername, color, speed, is_th, storage_requir local node = minetest.get_node(pos) local dir = spacecannon.facedir_to_down_dir(node.param2) local obj = minetest.add_entity({x=pos.x+dir.x, y=pos.y+dir.y, z=pos.z+dir.z}, "spacecannon:energycube_" .. color) - obj:setvelocity({x=dir.x*speed, y=dir.y*speed, z=dir.z*speed}) + obj:set_velocity({ x = dir.x * speed, y = dir.y * speed, z = dir.z * speed }) end -- destroy stuff in range