Prev: 46725 Up: Map Next: 46764
46740: Parser: Validate Two Direct Objects
Used by the routines at Action_Throw and Action_Play.
Parser: Validate Two Direct Objects.
Output
F The carry flag is set when the command is malformed
ParserValidateTwoDirectObjects 46740 CALL ParserValidateDirectObject Call ParserValidateDirectObject to check that the command names an object.
46743 RET C Return if there is no direct object in the user input (so the command is malformed).
A now contains the count of the number of valid direct objects.
46744 CP 1 Jump to ValidateTwoDirectObjects if the number of valid direct objects in the user input is not 1.
46746 JR NZ,ValidateTwoDirectObjects
There is only one valid direct object in the user input and the command needs two...
46748 CALL Messaging_PleaseBeMoreSpecific_Newline Call Messaging_PleaseBeMoreSpecific_Newline to ask for a more specific command.
46751 SCF Set the carry flag to report that the command is malformed.
46752 RET Return.
There are two or more valid direct objects in the user input.
ValidateTwoDirectObjects 46753 CP 3 Jump to ValidateTwoDirectObjects_TooMany if the number of valid direct objects in the user input is greater than or equal to 3.
46755 JR NC,ValidateTwoDirectObjects_TooMany
46757 AND A Clear the carry flag: exactly two objects were named, so the command is valid.
46758 RET Return.
There are more than two valid direct objects in the user input.
ValidateTwoDirectObjects_TooMany 46759 CALL Messaging_PleaseRephraseThat_Newline Call Messaging_PleaseRephraseThat_Newline to ask the player to rephrase.
46762 SCF Set the carry flag to report that the command is malformed.
46763 RET Return.
Prev: 46725 Up: Map Next: 46764