Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Commit f139bd6

Browse files
committed
Slightly change code to suppress compiler warning
1 parent a1c2b84 commit f139bd6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Solution/source/Submenus/VehicleModShop.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "..\Natives\natives2.h"
1818
#include "..\Util\GTAmath.h"
19+
#include "..\Util\StringManip.h"
1920
#include "..\Scripting\enums.h"
2021
#include "..\main.h"
2122
#include "..\Scripting\GTAvehicle.h"
@@ -1330,12 +1331,11 @@ namespace sub
13301331

13311332
if (ms_paints_hexinput)
13321333
{
1333-
char buffer[2041];
13341334
std::size_t hexcheck;
1335-
std::string titlestring,
1336-
hexr = _itoa(ms_paints_rgb_r, buffer, 16), //compiler says this may be unsafe
1337-
hexg = _itoa(ms_paints_rgb_g, buffer, 16), //I say fuck the compiler
1338-
hexb = _itoa(ms_paints_rgb_b, buffer, 16);
1335+
std::string titlestring;
1336+
std::string hexr = int_to_hexstring(ms_paints_rgb_r, false);
1337+
std::string hexg = int_to_hexstring(ms_paints_rgb_g, false);
1338+
std::string hexb = int_to_hexstring(ms_paints_rgb_b, false);
13391339
if (hexr.length() == 1)
13401340
hexr = "0" + hexr;
13411341
if (hexg.length() == 1)
@@ -2597,6 +2597,7 @@ namespace sub
25972597

25982598

25992599
Model Static_12_veh_model = GET_ENTITY_MODEL(Static_12);
2600+
bool isBike = Static_12_veh_model.IsBike();
26002601
INT wheel_no = GET_VEHICLE_MOD(Static_12, 23);
26012602
INT ms_custom_tyres = GET_VEHICLE_MOD_VARIATION(Static_12, 23);
26022603
BOOL ms_drift_tyres = _GET_DRIFT_TYRES_ENABLED(Static_12);
@@ -2618,9 +2619,9 @@ namespace sub
26182619

26192620
for (i = 0; i < vWheelTNames.size(); i++)
26202621
{
2621-
if (i == WheelType::BikeWheels && !Static_12_veh_model.IsBike()) continue;
2622-
if (i != WheelType::BikeWheels && Static_12_veh_model.IsBike()) continue; //removes all non-bike wheels from bike menu. Wheels don't render properly on bikes so makes sense to remove them to me. - ijc
2623-
__AddpointOption(vWheelTNames[i], i);
2622+
const bool ibw = (i == WheelType::BikeWheels);
2623+
if (isBike && ibw || !isBike && !ibw)
2624+
__AddpointOption(vWheelTNames[i], i);
26242625
}
26252626

26262627
AddLocal("CMOD_TYR_1", ms_custom_tyres, MSWheelsCustomTyres_, MSWheelsCustomTyres_, true); // Custom Tyres

0 commit comments

Comments
 (0)