 Rem File: Cmd088.bas
 Rem Sub: Enter.Vehicle
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 088 -- Enter.Vehicle."
    Color 7,0
    End
 Endif
 Call Enter.Vehicle
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Enter.Vehicle
 On Local Error Goto Error.Trap12
 Call Check.Room.Items
 If Temp7!<=SFalse Then
    Strng="That's not a vehicle!"
    Call IO.O
    Exit Sub
 Endif
 If TreasureRecord.Vehicle=False Then
    Strng="That's not a vehicle!"
    Call IO.O
    Exit Sub
 Endif
 Out3=TreasureRecord.ShortName
 Out3=Rtrim$(Out3)
 Out3=Lcase$(Out3)
 If Temp6=False Then
    Strng="The "+Out3+" is damaged!"
    Call IO.O
    Exit Sub
 Endif
 If MessWorkRecord6.User<>SFalse Then
    If MessWorkRecord6.User=User.Index Then
       Strng="You are already using the "+Out3+"!"
       Call IO.O
       Exit Sub
    Endif
    Var=TreasureRecord.Occupants
    If Var>False Then
       For Var2=1 To Var
          If MessWorkRecord6.Temp(Var2)=User.Index Then
             Strng="You are already using the "+Out3+"!"
             Call IO.O
             Exit Sub
          Endif
       Next
    Endif
 Endif
 If MessWorkRecord6.User=SFalse Then
    If Vehicle1 Then
       Call Pack.Vehicles
    Endif
    Call Read.Record(RoomInvFile,Temp5!)
    MessWorkRecord6.User=User.Index
    Call Write.Record(RoomInvFile,Temp5!)
    Vehicle1=Temp5!
    Vehicle2=0
    Vehicle3=Temp7!
    Vehicle4=TreasureRecord.VehicleType
    Strng="You enter the "+Out3+"."
    Call IO.O
    Exit Sub
 Endif
 If Var=False Then
    Strng="The vehicle has no occupancy!"
    Call IO.O
    Exit Sub
 Endif
 For Var2=1 To Var
    If MessWorkRecord6.Temp(Var2)=SFalse Then
       If Vehicle1 Then
          Call Pack.Vehicles
       Endif
       Call Read.Record(RoomInvFile,Temp5!)
       MessWorkRecord6.Temp(Var2)=User.Index
       Call Write.Record(RoomInvFile,Temp5!)
       Vehicle1=Temp5!
       Vehicle2=Var2
       Vehicle3=Temp7!
       Vehicle4=TreasureRecord.VehicleType
       Strng="You enter the "+Out3+"."
       Call IO.O
       Exit Sub
    Endif
 Next
 Strng="The "+Out3+" is in use."
 Call IO.O
Error.Resume12:
 Exit Sub
Error.Trap12:
 Resume Error.Resume12
End Sub
