Skip to content

Commit

Permalink
Fix vehicle command
Browse files Browse the repository at this point in the history
Removed old GetVehicle and created new one method and optimized
Forget the null checker if vehicle doesn't exists
  • Loading branch information
TH3AL3X committed Jul 14, 2024
1 parent cf4df0c commit 8020c8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Commands/MiscCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ private CommandResult VehicleCommand(ICommandSource src, ICommandArgs args, ICom

var optAsset = VehicleUtil.GetVehicle(args[0].ToString());

if (optAsset.id == null)
if (optAsset == null)
{
return CommandResult.LangError("INVALID_VEHICLE_ID", args[0]);
}
Expand All @@ -644,7 +644,7 @@ private CommandResult VehicleCommand(ICommandSource src, ICommandArgs args, ICom

optAsset = VehicleUtil.GetVehicle(args[1].ToString());

if(optAsset.id == null) {
if(optAsset == null) {
return CommandResult.LangError("INVALID_VEHICLE_ID", args[1]);
}

Expand Down

0 comments on commit 8020c8c

Please sign in to comment.