Skip to content

Commit c7ab3f8

Browse files
committed
make requested changes
1 parent 76559ad commit c7ab3f8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Client/mods/deathmatch/logic/CClientVehicle.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,22 +2948,24 @@ void CClientVehicle::Create()
29482948
// We hide all of them by default and only show the ones that match the current variation.
29492949
if (strTemp.rfind("extra", 0) == 0)
29502950
{
2951-
unsigned int id = atoi(strTemp.substr(5).c_str());
2951+
unsigned int id = std::stoi(strTemp.substr(5));
2952+
2953+
auto& component = iter->second;
29522954

29532955
// Hide extras > 6 by default
29542956
if (id > 6)
29552957
{
2956-
(*iter).second.m_bVisible = false;
2958+
component.m_bVisible = false;
29572959
}
29582960

29592961
// Show if matches variant
29602962
if (m_ucVariation > 5 && m_ucVariation < 254 && id == static_cast<unsigned int>(m_ucVariation) + 1)
29612963
{
2962-
(*iter).second.m_bVisible = true;
2964+
component.m_bVisible = true;
29632965
}
29642966
if (m_ucVariation2 > 5 && m_ucVariation2 < 254 && id == static_cast<unsigned int>(m_ucVariation2) + 1)
29652967
{
2966-
(*iter).second.m_bVisible = true;
2968+
component.m_bVisible = true;
29672969
}
29682970
}
29692971
// set our visibility

0 commit comments

Comments
 (0)