Make the boat immortal and turn better on laggy server
parent
8dc5a68ebf
commit
ea548b0cf6
5
init.lua
5
init.lua
|
@ -56,6 +56,7 @@ function boat:on_rightclick(clicker)
|
|||
end
|
||||
|
||||
function boat:on_activate(staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
if staticdata then
|
||||
self.v = tonumber(staticdata)
|
||||
end
|
||||
|
@ -83,10 +84,10 @@ function boat:on_step(dtime)
|
|||
self.v = self.v-0.08
|
||||
end
|
||||
if ctrl.left then
|
||||
self.object:setyaw(self.object:getyaw()+math.pi/120)
|
||||
self.object:setyaw(self.object:getyaw()+math.pi/120+dtime*math.pi/120)
|
||||
end
|
||||
if ctrl.right then
|
||||
self.object:setyaw(self.object:getyaw()-math.pi/120)
|
||||
self.object:setyaw(self.object:getyaw()-math.pi/120-dtime*math.pi/120)
|
||||
end
|
||||
end
|
||||
local s = get_sign(self.v)
|
||||
|
|
Loading…
Reference in New Issue