mirror of
https://github.com/APercy/ap_airship.git
synced 2025-03-14 23:41:21 +00:00
fix lag when climbing
This commit is contained in:
parent
e5f7682ee3
commit
73aa232731
1 changed files with 2 additions and 0 deletions
|
@ -192,8 +192,10 @@ function ap_airship.buoyancy_auto_correction(self, dtime)
|
||||||
--minetest.chat_send_player(self.driver_name, "antes: " .. self._baloon_buoyancy)
|
--minetest.chat_send_player(self.driver_name, "antes: " .. self._baloon_buoyancy)
|
||||||
if self._baloon_buoyancy > 0 then factor = -1 end
|
if self._baloon_buoyancy > 0 then factor = -1 end
|
||||||
local time_correction = (dtime/ap_airship.ideal_step)
|
local time_correction = (dtime/ap_airship.ideal_step)
|
||||||
|
if time_correction < 1 then time_correction = 1 end
|
||||||
local intensity = 0.001
|
local intensity = 0.001
|
||||||
local correction = (intensity*factor) * time_correction
|
local correction = (intensity*factor) * time_correction
|
||||||
|
if math.abs(correction) > 0.005 then correction = 0.005 * math.sign(correction) end
|
||||||
--minetest.chat_send_player(self.driver_name, correction)
|
--minetest.chat_send_player(self.driver_name, correction)
|
||||||
local before_correction = self._baloon_buoyancy
|
local before_correction = self._baloon_buoyancy
|
||||||
local new_baloon_buoyancy = self._baloon_buoyancy + correction
|
local new_baloon_buoyancy = self._baloon_buoyancy + correction
|
||||||
|
|
Loading…
Add table
Reference in a new issue