X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=misc.c;h=36339289ad71b8af759dc7738fe6a78e5a32318e;hp=6132b92150bd36756d56bdbab8bd1a02d5fad41d;hb=58a2de6d755bf42f19d668a0666124c1a930fc4f;hpb=9475552be419a8a018a27d524f6cdf64c0e26e4b diff --git a/misc.c b/misc.c index 6132b92..3633928 100644 --- a/misc.c +++ b/misc.c @@ -511,6 +511,7 @@ static void tokenize(char* raw, command_t *cmd) /* populate command with parsed vocabulary metadata */ get_vocab_metadata(cmd->word[0].raw, &(cmd->word[0].id), &(cmd->word[0].type)); get_vocab_metadata(cmd->word[1].raw, &(cmd->word[1].id), &(cmd->word[1].type)); + cmd->state = TOKENIZED; } bool get_command_input(command_t *command) @@ -551,9 +552,21 @@ bool get_command_input(command_t *command) command->word[1].id); #endif + command->state = GIVEN; return true; } +void clear_command(command_t *cmd) +/* Resets the state of the command to empty */ +{ + cmd->verb = ACT_NULL; + cmd->part = unknown; + game.oldobj = cmd->obj; + cmd->obj = NO_OBJECT; + cmd->state = EMPTY; +} + + void juggle(obj_t object) /* Juggle an object by picking it up and putting it down again, the purpose * being to get the object to the front of the chain of things at its loc. */