From b61520b9989b95d3a06c2edbe4903efd26d50861 Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Thu, 16 Feb 2023 23:08:18 +0000 Subject: [PATCH] Add non-functional stub for talk. - Added a message upon running '/talk'. This allows me to see if the command is actually executed. --- src/gamelogic.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gamelogic.c b/src/gamelogic.c index fdb0d2b..5743cee 100644 --- a/src/gamelogic.c +++ b/src/gamelogic.c @@ -297,7 +297,20 @@ int evaluateNextCommand(gameLogicParameters * parameters, queue * queue) // Talk command: Allows the player to begin a chat session with another player: if (strncmp(currentCommand->command, "talk", 4) == 0) { - // TODO: Implement. + userMessage * talkMessage = malloc(sizeof(userMessage)); + talkMessage->senderName[0] = '\0'; + + // Temporary message until we can implement objects, events, and challenges. + strcpy(talkMessage->messageContent, "The try command is currently not implemented. Implement it if you want to use it.\n"); + + // Allocate an outputMessage for the queue: + outputMessage * talkOutputMessage = createTargetedOutputMessage(talkMessage, ¤tCommand->caller, 1); + + // Queue the outputMessage: + pushQueue(parameters->outputQueue, talkOutputMessage, OUTPUT_MESSAGE); + + // Free the userMessage: + free(talkMessage); } // Stat command: Displays the current character's sheet. if (strncmp(currentCommand->command, "stat", 4) == 0)