Skip to content

Commit ac19ebf

Browse files
committed
Enable house vehicles to be respawned with "/v respawn"
Fixes #791
1 parent 93be183 commit ac19ebf

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

javascript/features/vehicles/vehicle_commands.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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);

javascript/features/vehicles/vehicle_manager.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)