RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
990 stars 175 forks source link

Lights=None in RoR.cfg crash air vehicles loading #3126

Open cryham opened 4 months ago

cryham commented 4 months ago

Took me a while to find out. So if I set Lights=None (fastest) in RoR.cfg then trying to get a new air vehicle (airplane, jet, helicopter etc) will crash RoR, not saying much in log. Checked on recent dev builds, on Debian 12, amdgpu.

ohlidalp commented 4 months ago

Oops. The problem will be either in ActorSpawner.cpp ProcessWings() or GfxActor.cpp UpdateFlares()

ohlidalp commented 4 months ago

SimData.h, line 636 is a suspect - not initialized pointer.

cryham commented 4 months ago

I've debugged the crash on my ogre-14 branch (hope it's the same) and it is in source/main/physics/ActorSpawner.cpp here:

    //wing closure
    if (m_first_wing_index!=-1)
    {
        if (m_actor->ar_autopilot != nullptr) 
        {
            m_actor->ar_autopilot->setInertialReferences(
                & m_actor->ar_nodes[m_airplane_left_light],
                & m_actor->ar_nodes[m_airplane_right_light],  // <-- nullptr
                m_actor->m_fusealge_back,
                & m_actor->ar_nodes[m_actor->ar_camera_node_pos[0]]
                );
        }

2nd argument for setInertialReferences( is null. If I comment out this call, then it works, and I can fly airplanes etc.