TheStarport/FLHook

Load all Systems correctly and not just by existing Bases

Closed this issue · 1 comments

IClientImpl__Startup__Inner does currently preload every system based on the list of Bases the game knows. However this does skip every system which does not have a Base. This can cause unexpected behaviour when trying to traverse e.g. SpaceObj initially for pre-loading plugin functionality.
To properly load the entire universe (as the comment of that function also states) it should load all Systems with this code:

        Universe::ISystem* system = Universe::GetFirstSystem();
        while (system)
        {
            if (!std::string(system->file).empty())
                pub::System::LoadSystem(system->id);
            system = Universe::GetNextSystem();
        }

The empty file path check is to prevent systems without files being loaded (Adoxa has at least one plugin that hijacks system entries for it this way!)

Fixed in 17353eb