Fixed vehicle extras to match the scripts (#3019)

This commit is contained in:
gir489 2024-05-01 17:24:20 -04:00 committed by GitHub
parent 7a25403912
commit 3470660b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 9 deletions

View File

@ -430,7 +430,6 @@ enum CustomVehicleModType
MOD_PRIMARY_CUSTOM = -131, MOD_PRIMARY_CUSTOM = -131,
MOD_SECONDARY_CUSTOM = -132, MOD_SECONDARY_CUSTOM = -132,
MOD_EXTRA_0 = -200,
MOD_EXTRA_1 = -201, MOD_EXTRA_1 = -201,
MOD_EXTRA_2 = -202, MOD_EXTRA_2 = -202,
MOD_EXTRA_3 = -203, MOD_EXTRA_3 = -203,

View File

@ -345,9 +345,9 @@ namespace big::vehicle
} }
// EXTRA // EXTRA
for (int extra = MOD_EXTRA_11; extra <= MOD_EXTRA_0; extra++) for (int extra = MOD_EXTRA_14; extra <= MOD_EXTRA_1; extra++)
{ {
int gta_extra_id = (extra - MOD_EXTRA_0) * -1; int gta_extra_id = (extra - MOD_EXTRA_1) * -1;
owned_mods[extra] = val_77 >> (gta_extra_id - 1) & 1; owned_mods[extra] = val_77 >> (gta_extra_id - 1) & 1;
} }
@ -438,9 +438,9 @@ namespace big::vehicle
} }
} }
for (int extra = MOD_EXTRA_11; extra <= MOD_EXTRA_0; extra++) for (int extra = MOD_EXTRA_14; extra <= MOD_EXTRA_1; extra++)
{ {
int gta_extra_id = (extra - MOD_EXTRA_0) * -1; int gta_extra_id = (extra - MOD_EXTRA_1) * -1;
if (owned_mods.count(extra) && VEHICLE::DOES_EXTRA_EXIST(vehicle, gta_extra_id)) if (owned_mods.count(extra) && VEHICLE::DOES_EXTRA_EXIST(vehicle, gta_extra_id))
{ {
VEHICLE::SET_VEHICLE_EXTRA(vehicle, gta_extra_id, owned_mods[extra] == 0); VEHICLE::SET_VEHICLE_EXTRA(vehicle, gta_extra_id, owned_mods[extra] == 0);
@ -526,9 +526,9 @@ namespace big::vehicle
} }
} }
for (int extra = MOD_EXTRA_11; extra <= MOD_EXTRA_0; extra++) for (int extra = MOD_EXTRA_14; extra <= MOD_EXTRA_1; extra++)
{ {
int gta_extra_id = (extra - MOD_EXTRA_0) * -1; int gta_extra_id = (extra - MOD_EXTRA_1) * -1;
if (VEHICLE::DOES_EXTRA_EXIST(vehicle, gta_extra_id)) if (VEHICLE::DOES_EXTRA_EXIST(vehicle, gta_extra_id))
{ {
owned_mods[extra] = VEHICLE::IS_VEHICLE_EXTRA_TURNED_ON(vehicle, gta_extra_id); owned_mods[extra] = VEHICLE::IS_VEHICLE_EXTRA_TURNED_ON(vehicle, gta_extra_id);

View File

@ -450,7 +450,7 @@ namespace big
} }
int item_counter = 0; int item_counter = 0;
for (int extra = MOD_EXTRA_0; extra >= MOD_EXTRA_14; extra--) for (int extra = MOD_EXTRA_1; extra >= MOD_EXTRA_14; extra--)
{ {
if (owned_mods.find(extra) != owned_mods.end()) if (owned_mods.find(extra) != owned_mods.end())
{ {
@ -461,7 +461,7 @@ namespace big
} }
if ((item_counter % 5) != 0) if ((item_counter % 5) != 0)
ImGui::SameLine(); ImGui::SameLine();
int gta_extra_id = (extra - MOD_EXTRA_0) * -1; int gta_extra_id = (extra - MOD_EXTRA_1) * -1;
auto name = std::format("{}: #{}", "VIEW_LSC_EXTRAS"_T, gta_extra_id); auto name = std::format("{}: #{}", "VIEW_LSC_EXTRAS"_T, gta_extra_id);
bool is_extra_enabled = owned_mods[extra] == 1; bool is_extra_enabled = owned_mods[extra] == 1;
if (ImGui::Checkbox(name.c_str(), &is_extra_enabled)) if (ImGui::Checkbox(name.c_str(), &is_extra_enabled))