-
-
Notifications
You must be signed in to change notification settings - Fork 502
Fix vehicle upgrades after #4114 #4128
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
Conversation
|
Could you elaborate on what exactly it fixes? |
Everything, because the previous pull request broke it all |
| bool CVehicleUpgrades::IsUpgradeCompatible(const std::uint16_t upgrade) noexcept | ||
| { | ||
| eClientVehicleType type = m_pVehicle->GetVehicleType(); | ||
| const auto type = m_pVehicle->GetVehicleType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to avoid replacing small types with auto.
| return false; | ||
| } | ||
|
|
||
| std::uint16_t model = m_pVehicle->GetModel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to avoid replacing small types with auto.
|
|
||
| const auto& set = it->second; | ||
|
|
||
| return set.find(upgrade) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about it->second.count(upgrade) > 0;
|
Why do we need |
So you opened a PR without even testing its changes or checking if it works at all? 👀 |
Why do I need that? Before any testing I want to understand the logic of PR. |
Mistake on my end, sorry. I did it as a favour, and I was in a rush, I just implemented the same logic with the old reviews. |
Thx for the quick review, I'll solve the issues soon. |
He adopted the original PR (#3261) just to comply with the last pending code reviews from TEDERIs it had. It should've been matured at that point. Btw, even after #4114 (by nightly testing) i can't really find issues, but no doubt that Nico found them due to this here. It's not a big deal, no recent nightly was released to users. |
Fixes vehicle upgrades