Skip to content
Permalink
Browse files
Create an additional block list for house vehicles
Fixes #796
  • Loading branch information
RussellLVP committed Aug 6, 2020
1 parent ca375c6 commit 7d7f21777c93a44be2256a9072b8bb1a22328a75
Showing 1 changed file with 24 additions and 0 deletions.
@@ -9,6 +9,27 @@ import { VehicleModel } from 'entities/vehicle_model.js';
import { alert } from 'components/dialogs/alert.js';
import { confirm } from 'components/dialogs/confirm.js';

// Additional block list for vehicles that cannot be saved as house vehicles.
const kVehicleModelBlockList = new Set([
406 /* Dumper */,
408 /* Trashmaster */,
427 /* Enforcer */,
431 /* Bus */,
432 /* Rhino */,
444 /* Monaster */,
486 /* Dozer */,
524 /* Cement Truck */,
528 /* FBI Truck */,
532 /* Combine Harvester */,
537 /* Freight Train */,
538 /* Passenger Train */,
544 /* Firetruck */,
556 /* Monster A */,
557 /* Monster B */,
578 /* DFT-30 */,
601 /* SWAT Tank */,
]);

// Responsible for allowing players to save any vehicle as their house vehicles, even when they have
// tuned and/or customised it to their liking with the server's regular abilities.
export class HouseVehicleCommands extends VehicleCommandDelegate {
@@ -193,6 +214,9 @@ export class HouseVehicleCommands extends VehicleCommandDelegate {
if (!vehicleModel)
return false;

if (kVehicleModelBlockList.has(vehicleModel.id))
return false;

return !vehicleModel.isAirborne() &&
!vehicleModel.isRemoteControllable() &&
!vehicleModel.isTrailer();

0 comments on commit 7d7f217

Please sign in to comment.