diff --git a/control.lua b/control.lua index c3e462d..e9b0dd9 100755 --- a/control.lua +++ b/control.lua @@ -141,8 +141,10 @@ function steampunk_blimp.buoyancy_auto_correction(self, dtime) --minetest.chat_send_player(self.driver_name, "antes: " .. self._baloon_buoyancy) if self._baloon_buoyancy > 0 then factor = -1 end local time_correction = (dtime/steampunk_blimp.ideal_step) + if time_correction < 1 then time_correction = 1 end local intensity = 0.2 - local correction = (intensity*factor) * math.max(time_correction, steampunk_blimp.ideal_step) + local correction = (intensity*factor) * time_correction + if math.abs(correction) > 0.5 then correction = 0.5 * math.sign(correction) end --minetest.chat_send_player(self.driver_name, correction) local before_correction = self._baloon_buoyancy local new_baloon_buoyancy = self._baloon_buoyancy + correction diff --git a/engine_management.lua b/engine_management.lua index 8c5175a..eab6e1f 100644 --- a/engine_management.lua +++ b/engine_management.lua @@ -66,7 +66,10 @@ end local function furnace_step(self, accel) if self._energy > 0 and self._engine_running then local consumed_power = (1/steampunk_blimp.FUEL_CONSUMPTION) - self._boiler_pressure = self._boiler_pressure + gained_pressure --pressure for the boiler + local time_correction = (self.dtime/steampunk_blimp.ideal_step) + if time_correction < 1 then time_correction = 1 end + local dtimed_pressure = gained_pressure*time_correction + self._boiler_pressure = self._boiler_pressure + dtimed_pressure --pressure for the boiler self._energy = self._energy - consumed_power; --removes energy end if self._energy <= 0 or self._water_level <= 0 then