Skip to content

Commit

Permalink
Pass through though existing saved vehicle's category when replacing
Browse files Browse the repository at this point in the history
  • Loading branch information
cm8263 committed Jul 1, 2024
1 parent 32e4de7 commit fe50202
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ public struct VehicleInfo
/// <summary>
/// Saves the vehicle the player is currently in to the client's kvp storage.
/// </summary>
public static async void SaveVehicle(string updateExistingSavedVehicleName = null)
public static async void SaveVehicle(string updateExistingSavedVehicleName = null, string existingCatergory = null)
{
// Only continue if the player is in a vehicle.
if (Game.PlayerPed.IsInVehicle())
Expand Down Expand Up @@ -1584,7 +1584,7 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
bulletProofTires = !veh.CanTiresBurst,
headlightColor = VehicleOptions.GetHeadlightsColorForVehicle(veh),
enveffScale = GetVehicleEnveffScale(veh.Handle),
Category = "Uncategorized"
Category = string.IsNullOrEmpty(existingCatergory) ? "Uncategorized" : existingCatergory
};

#endregion
Expand Down
2 changes: 1 addition & 1 deletion vMenu/menus/SavedVehicles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ string ChangeCallback(MenuDynamicListItem item, bool left)
{
replaceButtonPressedCount = 0;
item.Label = "";
SaveVehicle(currentlySelectedVehicle.Key.Substring(4));
SaveVehicle(currentlySelectedVehicle.Key.Substring(4), currentlySelectedVehicle.Value.Category);
selectedVehicleMenu.GoBack();
Notify.Success("Your saved vehicle has been replaced with your current vehicle.");
}
Expand Down

0 comments on commit fe50202

Please sign in to comment.