Skip to content

Commit

Permalink
Tuning: fixed tire radius not applying if rim radius not set
Browse files Browse the repository at this point in the history
I fixed the 'addonpart_tweak_wheel tire radius won't apply if rim radius value is missing' bug
  • Loading branch information
po185021 committed Dec 31, 2023
1 parent a7e78e2 commit 5fa2575
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,14 @@ void AddonPartUtility::ProcessTweakWheel()
if (m_tuneup->wheel_tweaks.find(wheel_id) == m_tuneup->wheel_tweaks.end())
{
TuneupWheelTweak data;
bool stop = false;
data.twt_origin = m_addonpart_entry->fname;
data.twt_wheel_id = wheel_id;
data.twt_media[0] = m_context->getTokString(2);
if (m_context->isTokString(3)) { data.twt_media[1] = m_context->getTokString(3); }
if (m_context->isTokString(4)) { data.twt_side = (m_context->getTokString(4)[0] == 'l') ? WheelSide::LEFT : WheelSide::RIGHT; }
if (m_context->isTokFloat(5)) { data.twt_rim_radius = m_context->getTokFloat(5); }
if (m_context->isTokFloat(6)) { data.twt_tire_radius = m_context->getTokFloat(6); }
if (!stop && m_context->isTokString(3)) { data.twt_media[1] = m_context->getTokString(3); } else { stop=true; }
if (!stop && m_context->isTokString(4)) { data.twt_side = (m_context->getTokString(4)[0] == 'l') ? WheelSide::LEFT : WheelSide::RIGHT; } else { stop=true; }
if (!stop && m_context->isTokFloat(5)) { data.twt_tire_radius = m_context->getTokFloat(5); } else { stop=true; }
if (!stop && m_context->isTokFloat(6)) { data.twt_rim_radius = m_context->getTokFloat(6); } else { stop=true; }
m_tuneup->wheel_tweaks.insert(std::make_pair(wheel_id, data));

LOG(fmt::format("[RoR|Addonpart] INFO: file '{}', element '{}': tweaking wheel {}"
Expand Down

0 comments on commit 5fa2575

Please sign in to comment.