Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove dead code in CClientVehicle::SetEngineBroken #1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
sbx320 merged 1 commit into multitheftauto:master from sbx320:cleanup/deadcode
Nov 17, 2020

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.

AlexTMjugador and Pirulax reacted with thumbs up emoji
@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

Reviewers

2 more reviewers

@qaisjp qaisjp qaisjp approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

1.5.9

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /