Skip to content

Commit

Permalink
Applied fix to account for multi-line incomplete quotes in-text
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoskagami committed Aug 25, 2014
1 parent e6854d1 commit 694cfcc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vndc/include/Data.hpp
Expand Up @@ -28,7 +28,7 @@ class DataContainer {
FILE* accessScriptHandle = NULL;
char** main_scr; // Default value.
bool vndc_enabled = true;
bool is_spoken_line = false;
bool quote_incomplete = false;
bool debug_mode = false;
bool debug_to_shell = false;
bool verbose = false;
Expand Down
15 changes: 14 additions & 1 deletion vndc/src/op_sound.cpp
Expand Up @@ -25,8 +25,21 @@ void op_sound(char* file, int* times) {

if(GetData()->vndc_enabled && // 0 1 2 3 4 5
(GetData()->next_line[5] == '"' || // t e x t "
GetData()->next_line[strlen(GetData()->next_line) - 1] == '"')) {
GetData()->next_line[strlen(GetData()->next_line) - 1] == '"' ||
GetData()->quote_incomplete)) {
GetData()->ctx->Audio()->FlushSfx();

if(GetData()->next_line[5] == '"' &&
!(GetData()->next_line[strlen(GetData()->next_line) - 1] == '"')) {
// Quote is incomplete.
GetData()->quote_incomplete = true;
}

if(GetData()->next_line[strlen(GetData()->next_line) - 1] == '"' &&
!(GetData()->next_line[5] == '"')) {
GetData()->quote_incomplete = false;
}

}

// Play command
Expand Down

0 comments on commit 694cfcc

Please sign in to comment.