1
0
mirror of https://github.com/HybridDog/builtin_item.git synced 2024-12-23 01:10:26 +01:00

Use new underscore in set_acceleration and set_velocity

This commit is contained in:
HybridDog 2018-10-03 17:37:20 +02:00
parent 143ab1f8dd
commit 1c7473dc54

View File

@ -94,11 +94,11 @@ item_entity.on_step = function(self, dtime)
if self.bt_acc if self.bt_acc
and not vector.equals(self.object:getacceleration(), self.bt_acc) then and not vector.equals(self.object:getacceleration(), self.bt_acc) then
self.object:setacceleration(self.bt_acc) self.object:set_acceleration(self.bt_acc)
end end
if self.bt_vel if self.bt_vel
and not vector.equals(self.object:getvelocity(), self.bt_vel) then and not vector.equals(self.object:getvelocity(), self.bt_vel) then
self.object:setvelocity(self.bt_vel) self.object:set_velocity(self.bt_vel)
end end
if self.bt_phys ~= nil if self.bt_phys ~= nil
and self.physical_state ~= self.bt_phys then and self.physical_state ~= self.bt_phys then
@ -154,7 +154,7 @@ item_entity.on_step = function(self, dtime)
local acc local acc
if tmp.liquidtype then if tmp.liquidtype then
acc = {x=0, y=core.get_gravity()*(((p.y-.5)%1)*.9-1), z=0} acc = {x=0, y=core.get_gravity()*(((p.y-.5)%1)*.9-1), z=0}
self.object:setacceleration(acc) self.object:set_acceleration(acc)
self.bt_acc = acc self.bt_acc = acc
else else
self.bt_acc = nil self.bt_acc = nil
@ -167,7 +167,7 @@ item_entity.on_step = function(self, dtime)
vector.multiply(vector.subtract(vec, pos),.5) vector.multiply(vector.subtract(vec, pos),.5)
) )
self.bt_vel = v self.bt_vel = v
self.object:setvelocity(v) self.object:set_velocity(v)
self.physical_state = true self.physical_state = true
self.bt_phys = true self.bt_phys = true
self.object:set_properties({ self.object:set_properties({