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

Sub Discard.Object
 On Local Error Goto Error.Trap186
 Call Check.Inventory.Treasure
 If Temp7! Then
    Call Discard(Temp5!,True)
    Graphics.Off=False
    Strng="You discard "+Rtrim$(TreasureRecord.Prefix1)+Lcase$(Out3)
    Call Convert.ANSI(True,VarQ,VarR)
    Carriage.Return=True
    Graphics.On=True
    Call IO.O
    Graphics.On=False
    Graphics.Off=True
    Strng="!"
    Call IO.O
    Graphics.Off=False
    Exit Sub
 Endif
 Call Num
 Call Check.Inventory.Objects
 If Temp7! Then
    MessWorkRecord6.User=SFalse
    Call Write.Record(MessWorkFile6,Temp5!)
    Graphics.Off=False
    Strng="You discard "+Rtrim$(ObjectRecord.Prefix1)+Lcase$(Out3)
    Call Convert.ANSI(True,VarQ,VarR)
    Carriage.Return=True
    Graphics.On=True
    Call IO.O
    Graphics.On=False
    Graphics.Off=True
    Strng="!"
    Call IO.O
    Graphics.Off=False
    Exit Sub
 Endif
 Call Num
 Call Search.User.Containers
 If TempA! Then
    Weight=Weight-ContainerRecord.Weight
    Var$=Rtrim$(ContainerRecord.Prefix1)
    Call Delete.User.Container(TempA!)
    Call Clear.Container
    Call Write.Record(ContainerFile,TempA!)
    Graphics.Off=False
    Strng="You discard "+Var$+Lcase$(Out3)
    Call Convert.ANSI(True,VarQ,VarR)
    Carriage.Return=True
    Graphics.On=True
    Call IO.O
    Graphics.On=False
    Graphics.Off=True
    Strng="!"
    Call IO.O
    Graphics.Off=False
    Exit Sub
 Endif
 Strng="You can't discard that!"
 Call IO.O
Error.Resume186:
 Exit Sub
Error.Trap186:
 Resume Error.Resume186
End Sub
