]> Chaos Git - vn/vndc.git/commitdiff
Fixed up voice detect this time. PERMANENTLY. I hope.
authorchaoskagami <chaos.kagami@gmail.com>
Mon, 25 Aug 2014 03:53:59 +0000 (23:53 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Mon, 25 Aug 2014 03:53:59 +0000 (23:53 -0400)
vndc/src/op_sound.cpp
vndc/src/op_text.cpp

index e219cacec4cc276ddaecdabb630fb3551c0f413c..ad34f651583674cb6f59cb55372978e9b1ba7751 100644 (file)
@@ -23,17 +23,11 @@ void op_sound(char* file, int* times) {
        // set - e.g. the sound was a voice as well, we stop the previous
        // sound before playing this one.
 
-       if(GetData()->vndc_enabled &&
-          (GetData()->next_line[6] == '"' ||
+       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] == '"')) {
-               if(GetData()->is_spoken_line == true) {
-                       GetData()->ctx->Audio()->FlushSfx();
-               }
-               GetData()->is_spoken_line = true;
+               GetData()->ctx->Audio()->FlushSfx();
        }
-       else
-               GetData()->is_spoken_line = false;
-
 
        // Play command
        int count = 1;
index 4bf8f7b130505802804e65d06cff58866b9f89f8..6b3be614d924b6fbd9489f6df40f89cde0fca4d0 100644 (file)
@@ -33,13 +33,16 @@ void op_text(char* string) {
 
                TextManager* txt = GetData()->ctx->Text();
 
-               int xloc = ( GetData()->screen_w - txt->TestLen(string) - GetData()->render_x1 );
+               int xloc = ( GetData()->screen_w - (txt->TestLen(string) + GetData()->render_x1) );
                
                txt->Render(string, xloc, GetData()->render_y1);
 
+               GetData()->wait_input = true;
                Wait();
 
                op_cleartext();
+
+               return;
        }
        // Wait for input, then blank
        if(!strcmp(string, "!")) {