Do not need to create new vector each time
This commit is contained in:
parent
6097dacbab
commit
038d9ec014
@ -1006,8 +1006,8 @@ function mob_class:check_suspend(player_in_active_range)
|
||||
local acc = self.object:get_acceleration()
|
||||
if acc then
|
||||
if acc.y > 0 or node_under ~= "air" then
|
||||
self.object:set_acceleration(vector.new(0,0,0))
|
||||
self.object:set_velocity(vector.new(0,0,0))
|
||||
self.object:set_acceleration(vector.zero())
|
||||
self.object:set_velocity(vector.zero())
|
||||
end
|
||||
if acc.y == 0 and node_under == "air" then
|
||||
self:falling(pos)
|
||||
|
Loading…
Reference in New Issue
Block a user