From: chaoskagami Date: Mon, 25 Aug 2014 06:05:32 +0000 (-0400) Subject: Applied fix to account for multi-line incomplete quotes in-text X-Git-Tag: stable-2 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=694cfccbc7a440a36e6cd28bbea6d75d02cf4ac7;p=vn%2Fvndc.git Applied fix to account for multi-line incomplete quotes in-text --- 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