Aircraft Realism

by haih_ys

Adds mechanics to make vehicles behave as planes. [Takeoff/Landing, Runway Requirement]

Content
3 months ago
0.17 - 1.1
52.2K
Transportation

g ✔️ UPS drain even with no aircrafts

1 year, 7 months ago
(updated 1 year, 7 months ago)

This mod is causing a high UPS usage when I'm sitting in non-aircrafts. UPS for this mod is hovering around 0.8. I tend to live in a spidertron, so this UPS usage is constant. I did some poking around, and it looks like getPlaneData is doing a ton of work every tick since it's getting called for each module.
Adding the following caching fixed the problem and brought UPS usage to a reasonable 0.06:

local global_plane_data = nil
local function getPlaneData(dataStage)
  if global_plane_data ~= nil then
    return global_plane_data
  end
 ...
  global_plane_data = planeData
  return planeData
end
1 year, 6 months ago

Issue is resolved in v1.5.3, thanks for the help.

1 year, 6 months ago

Thanks!

New response