Skip to content

Commit c6f7c02

Browse files
authored
Fix deprication warnings (#24)
* fix deprication warning 'initial_properties' WARNING[Server]: Reading initial object properties directly from an entity definition is deprecated, move it to the 'initial_properties' table instead. (Property 'static_save' in entity 'spacecannon:energycube_<colour>') * fix deprication warning getpos -> get_pos WARNING[Server]: Call to deprecated function 'getpos', use 'get_pos' instead. * Fix deprication warning set_velocity Call to deprecated function 'setvelocity', use 'set_velocity' instead
1 parent 3b1559c commit c6f7c02

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cannon.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ local register_spacecannon = function(def)
3535
entity_texture
3636
},
3737
collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25},
38-
physical = false
38+
physical = false,
39+
static_save = false,
3940
},
4041
timer = 0,
4142
lifetime = 0,
42-
static_save = false,
4343
penetrated = 0,
4444

4545
on_step = function(self, dtime)
@@ -51,7 +51,7 @@ local register_spacecannon = function(def)
5151
return
5252
end
5353

54-
local pos = self.object:getpos()
54+
local pos = self.object:get_pos()
5555

5656
if self.timer > 0.5 then
5757
-- add sparks along the way

util.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ spacecannon.fire = function(pos, playername, color, speed, is_th, storage_requir
117117
local node = minetest.get_node(pos)
118118
local dir = spacecannon.facedir_to_down_dir(node.param2)
119119
local obj = minetest.add_entity({x=pos.x+dir.x, y=pos.y+dir.y, z=pos.z+dir.z}, "spacecannon:energycube_" .. color)
120-
obj:setvelocity({x=dir.x*speed, y=dir.y*speed, z=dir.z*speed})
120+
obj:set_velocity({ x = dir.x * speed, y = dir.y * speed, z = dir.z * speed })
121121
end
122122

123123
-- destroy stuff in range

0 commit comments

Comments
 (0)