Aircraft Realism

by haih_ys

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

Content
2 days ago
0.17 - 1.1
47.6K
Transportation

g ✔️ UPS drain even with no aircrafts

1 year, 1 month ago
(updated 1 year, 1 month 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, 8 days ago

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

1 year, 3 days ago

Thanks!

New response