Skip to content
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

Fixed wheel visibility when using setVehicleWheelStates #1556 #3154

Merged
merged 27 commits into from
Jan 9, 2024
Merged
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
83599ca
Fixed wheel visibility when using setVehicleWheelStates #1556
FileEX Aug 11, 2023
9327185
Small refactoring
FileEX Aug 12, 2023
fba461a
Using static const string
FileEX Aug 12, 2023
9b1987f
Significant code simplification
FileEX Aug 12, 2023
832ad0e
Add "GetComponentNameForWheel" function
FileEX Aug 12, 2023
5cb7dae
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 12, 2023
bba6326
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 13, 2023
a749c48
Update Client/mods/deathmatch/logic/CClientVehicle.h
FileEX Aug 13, 2023
d1135e3
Update CClientVehicle.cpp
FileEX Aug 13, 2023
cf8aff2
Update CClientVehicle.cpp
FileEX Aug 13, 2023
3c5f2a6
Update switch
FileEX Aug 13, 2023
ba3121a
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 15, 2023
61e9a17
Update CClientVehicle.cpp
FileEX Aug 15, 2023
b433e5a
Merge branch 'bugfix/wheels_visibility' of https://github.com/FileEX/…
FileEX Aug 15, 2023
192a97d
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 15, 2023
68a44c6
Update
FileEX Aug 16, 2023
c5ba920
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 18, 2023
4b8937e
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 23, 2023
ea84539
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 26, 2023
9848764
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 29, 2023
a28567c
Merge branch 'master' into bugfix/wheels_visibility
FileEX Aug 30, 2023
21cef43
Merge branch 'master' into bugfix/wheels_visibility
FileEX Sep 15, 2023
b6fb00f
Merge branch 'master' into bugfix/wheels_visibility
FileEX Sep 18, 2023
ea66c1a
Merge branch 'master' into bugfix/wheels_visibility
FileEX Dec 16, 2023
eab4152
Merge branch 'master' into bugfix/wheels_visibility
FileEX Jan 5, 2024
13f739e
Merge branch 'master' into bugfix/wheels_visibility
FileEX Jan 7, 2024
c19f6d0
Merge branch 'master' into bugfix/wheels_visibility
Dutchman101 Jan 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Client/mods/deathmatch/logic/CClientVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,30 @@ void CClientVehicle::SetWheelStatus(unsigned char ucWheel, unsigned char ucStatu

// Update the wheel's visibility
m_pVehicle->SetWheelVisibility((eWheelPosition)ucWheel, (ucStatus != DT_WHEEL_MISSING));

// restart wheels component visibility (fix #1556)
static const SString strWheelPrefix = "wheel_";

for (const auto& [key, value] : m_ComponentData)
{
SString strComponentName = key;
FileEX marked this conversation as resolved.
Show resolved Hide resolved
if (strComponentName.BeginsWith(strWheelPrefix))
{
unsigned char ucComponentWheel;

if (strComponentName == "wheel_lf_dummy")
ucComponentWheel = FRONT_LEFT_WHEEL;
else if (strComponentName == "wheel_rf_dummy")
ucComponentWheel = FRONT_RIGHT_WHEEL;
else if (strComponentName == "wheel_lb_dummy")
ucComponentWheel = REAR_LEFT_WHEEL;
else if (strComponentName == "wheel_rb_dummy")
ucComponentWheel = REAR_RIGHT_WHEEL;

if (ucComponentWheel == ucWheel && m_ucWheelStates[ucWheel] != DT_WHEEL_MISSING && ucStatus != DT_WHEEL_MISSING)
SetComponentVisible(strComponentName, value.m_bVisible);
}
}
}
else if (m_eVehicleType == CLIENTVEHICLE_BIKE && ucWheel < 2)
m_pVehicle->SetBikeWheelStatus(ucWheel, ucGTAStatus);
Expand Down