Skip to content

Conversation

@sbx320
Copy link
Member

@sbx320 sbx320 commented Nov 9, 2020

So this one is a bit weird. The code we have right now does the following:

        m_pVehicle->SetEngineBroken(bEngineBroken);
        m_pVehicle->SetEngineOn(!bEngineBroken);

        // We need to recreate the vehicle if we're going from broken to unbroken
        if (!bEngineBroken && m_pVehicle->IsEngineBroken())
        {
            ReCreate();
        }

The if is never actually taken, since IsEngineBroken() == bEngineBroken due to previously setting SetEngineBroken(bEngineBroken);. Usually I'd just fix the issue, however after looking into git blame we've had that issue (at least) since the initial open sourcing of MTA back in 2008. As I'm not aware of us having any issues with broken engines, I'd suggest we just remove the unused part of the code.

@sbx320 sbx320 merged commit 778d48a into multitheftauto:master Nov 17, 2020
@sbx320 sbx320 deleted the cleanup/deadcode branch November 17, 2020 04:34
@StrixG StrixG added this to the 1.6 milestone Nov 23, 2020
@botder botder modified the milestones: 1.6, Spring Maintenance Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants