From 80372fb55f05efcb5a63158785a7bd365e8ffc73 Mon Sep 17 00:00:00 2001 From: lealeelu Date: Sat, 6 Aug 2016 13:28:34 -0400 Subject: [PATCH] Bail out first thing if comment --- .../Narrative/Scripts/ConversationManager.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Fungus/Narrative/Scripts/ConversationManager.cs b/Assets/Fungus/Narrative/Scripts/ConversationManager.cs index 814e948d..1ee5e9cf 100644 --- a/Assets/Fungus/Narrative/Scripts/ConversationManager.cs +++ b/Assets/Fungus/Narrative/Scripts/ConversationManager.cs @@ -76,7 +76,13 @@ namespace Fungus { ConversationItem item = conversationItems[i]; - if (item.Character != null) + // Ignore Lua style comments and blank lines + if (item.Text.StartsWith("--") || item.Text.Trim() == "") + { + continue; + } + + if (item.Character != null) { currentCharacter = item.Character; } @@ -137,13 +143,7 @@ namespace Fungus } previousCharacter = currentCharacter; - - // Ignore Lua style comments and blank lines - if (item.Text.StartsWith("--") || item.Text.Trim() == "") - { - continue; - } - + exitSayWait = false; sayDialog.Say(item.Text, true, true, true, false, null, () => { exitSayWait = true;