Exemple #1
0
        public void AddVehicle(VehicleObject v)
        {
            if (v.Name == "rpg_PlayerVehicle")
            {
                var existingPlayerVehicle = Vehicles.FirstOrDefault(vh => vh.Name == "rpg_PlayerVehicle");
                var vx = Game.Player.Character.CurrentVehicle;
                if (existingPlayerVehicle != null && (vx == null || vx.Handle != existingPlayerVehicle.EntityHandle))
                {
                    existingPlayerVehicle.Destroy();
                }
                RPG.PlayerData.CurrentVehicle = v.Veh;
            }

            Vehicles.Add(v);

            if (v.Name != "rpg_PlayerVehicle")
            {
                TreatObjectAsDeletableIfTooMany(v);
            }
        }
Exemple #2
0
 public void RemoveVehicle(VehicleObject veh)
 {
     Vehicles.Remove(veh);
 }