mirror of
https://github.com/pandorabox-io/spacecannon.git
synced 2025-01-02 02:57:29 +01:00
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
This commit is contained in:
parent
3b1559ccb1
commit
c6f7c02e79
@ -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
|
||||
|
2
util.lua
2
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
|
||||
|
Loading…
Reference in New Issue
Block a user