Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Proper adaption (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
Booster1212 committed Aug 13, 2023
1 parent 41bbc82 commit 70801b3
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/core/server/vehicle/tuning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,15 @@ export function getTuning(vehicle: alt.Vehicle): VehicleTuning {

let tuningData: VehicleTuning = { modkit: vehicle.modKit, mods: [] };

for (let id = 0; id < 70; ++id) {
for (let id = 0; id < 67; ++id) {
let value = vehicle.getMod(id);
tuningData.mods.push({ id, value });
if (id === 23) {
tuningData.mods.push({ id, value: vehicle.frontWheels });
} else if (id === 24) {
tuningData.mods.push({ id, value: vehicle.rearWheels });
} else {
tuningData.mods.push({ id, value });
}
}

return tuningData;
Expand Down Expand Up @@ -172,8 +178,14 @@ export function getMods(vehicle: alt.Vehicle): Array<IVehicleMod> {

for (let i = 0; i < 67; i++) {
try {
const value = vehicle.getMod(i);
mods.push({ id: i, value });
let value = vehicle.getMod(i);
if (i === 23) {
mods.push({ id: i, value: vehicle.frontWheels });
} else if (i === 24) {
mods.push({ id: i, value: vehicle.rearWheels });
} else {
mods.push({ id: i, value });
}
} catch (err) {}
}

Expand Down

0 comments on commit 70801b3

Please sign in to comment.