From 694cfccbc7a440a36e6cd28bbea6d75d02cf4ac7 Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Mon, 25 Aug 2014 02:05:32 -0400 Subject: [PATCH] Applied fix to account for multi-line incomplete quotes in-text --- vndc/include/Data.hpp | 2 +- vndc/src/op_sound.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/vndc/include/Data.hpp b/vndc/include/Data.hpp index add415f..9cd7843 100644 --- a/vndc/include/Data.hpp +++ b/vndc/include/Data.hpp @@ -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; diff --git a/vndc/src/op_sound.cpp b/vndc/src/op_sound.cpp index ad34f65..542ed49 100644 --- a/vndc/src/op_sound.cpp +++ b/vndc/src/op_sound.cpp @@ -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 -- 2.39.5