File tree Expand file tree Collapse file tree
javascript/features/vehicles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,12 +431,6 @@ class VehicleCommands {
431431 return ;
432432 }
433433
434- // Bail out if the |subject| is not driving a vehicle, or it's not managed by this system.
435- if ( ! this . manager_ . isManagedVehicle ( vehicle ) ) {
436- player . sendMessage ( Message . VEHICLE_NOT_DRIVING , subject . name ) ;
437- return ;
438- }
439-
440434 this . manager_ . respawnVehicle ( vehicle ) ;
441435
442436 player . sendMessage ( Message . VEHICLE_RESPAWNED , vehicle . model . name ) ;
Original file line number Diff line number Diff line change @@ -290,10 +290,7 @@ class VehicleManager {
290290 // vehicle will be reset prior to the actual respawn.
291291 respawnVehicle ( vehicle ) {
292292 const result = this . findStreamableVehicle ( vehicle ) ;
293- if ( ! result )
294- throw new Error ( `Unable to respawn vehicles not managed by the Vehicle Manager.` ) ;
295-
296- // Recursively respawn the vehicle and all trailers attached.
293+
297294 while ( vehicle ) {
298295 const trailer = vehicle . trailer ;
299296
@@ -302,7 +299,7 @@ class VehicleManager {
302299 }
303300
304301 // If the |vehicle| was an ephemeral vehicle, delete it from the server.
305- if ( result . type === VehicleManager . kTypeEphemeral )
302+ if ( result && result . type === VehicleManager . kTypeEphemeral )
306303 this . streamer_ ( ) . deleteVehicle ( result . streamableVehicle ) ;
307304 }
308305
You can’t perform that action at this time.
0 commit comments