diff --git a/queen/talk.cpp b/queen/talk.cpp index 4ed89f97954..2b211400b08 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -605,13 +605,18 @@ int Talk::countSpaces(const char *segment) { } void Talk::speakSegment( - const char *segment, + const char *segmentStart, int length, Person *person, int command, const char *voiceFilePrefix, int index) { - // Function SPEAK_SUB, lines 1406-1870 in talk.c + // Function SPEAK_SUB, lines 1406-1870 in talk.a + + char segment[MAX_STRING_SIZE]; + memcpy(segment, segmentStart, length); + segment[length] = '\0'; + char voiceFileName[MAX_STRING_SIZE]; snprintf(voiceFileName, sizeof(voiceFileName), "%s%1x", voiceFilePrefix, index); diff --git a/queen/talk.h b/queen/talk.h index 6b14d48ddc7..557d68e0411 100644 --- a/queen/talk.h +++ b/queen/talk.h @@ -186,7 +186,7 @@ class Talk { //! Speak a part of a sentence void speakSegment( - const char *segment, + const char *segmentStart, int length, Person *person, int command,