Fixed the name being sent to the wrong user's prompt while talking.

- The talking prompt was being sent to the receiving user, not the sending user.
This commit is contained in:
Barra Ó Catháin 2023-02-27 17:07:03 +00:00
parent 50f4e6c38a
commit f83c03aadf
1 changed files with 2 additions and 2 deletions

View File

@ -646,8 +646,6 @@ int evaluateNextCommand(gameLogicParameters * parameters, queue * queue)
currentCommand->caller->talkingWith = &(parameters->connectedPlayers[playerIndex]); currentCommand->caller->talkingWith = &(parameters->connectedPlayers[playerIndex]);
// Fill out the message to inform the receiving user what is happening: // Fill out the message to inform the receiving user what is happening:
strncat(&talkMessage->senderName[1], currentCommand->caller->playerName, 27);
strncat(&talkMessage->senderName[1], " > ", 4);
strncpy(talkMessage->messageContent, currentCommand->caller->playerName, 31); strncpy(talkMessage->messageContent, currentCommand->caller->playerName, 31);
strcat(talkMessage->messageContent, " is talking to you."); strcat(talkMessage->messageContent, " is talking to you.");
@ -661,6 +659,8 @@ int evaluateNextCommand(gameLogicParameters * parameters, queue * queue)
pushQueue(parameters->outputQueue, talkReceiverMessage, OUTPUT_MESSAGE); pushQueue(parameters->outputQueue, talkReceiverMessage, OUTPUT_MESSAGE);
// Prep the message to the calling user. // Prep the message to the calling user.
strncat(&talkMessage->senderName[1], currentCommand->arguments, 27);
strncat(&talkMessage->senderName[1], " > ", 4);
strcpy(talkMessage->messageContent, "Conversation begun with: "); strcpy(talkMessage->messageContent, "Conversation begun with: ");
strcat(talkMessage->messageContent, parameters->connectedPlayers[playerIndex].playerName); strcat(talkMessage->messageContent, parameters->connectedPlayers[playerIndex].playerName);
} }