From 3776051f96f0c578f4c4285d68b9dc7ff3c1fb3b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 30 Sep 2011 20:42:09 +0000 Subject: [PATCH] Make the karaoke syllable table from aegisub.parse_karaoke_data zero-based for backward compatibility Originally committed to SVN as r5694. --- aegisub/src/auto4_lua_assfile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aegisub/src/auto4_lua_assfile.cpp b/aegisub/src/auto4_lua_assfile.cpp index badbdefb2..e7d74d154 100644 --- a/aegisub/src/auto4_lua_assfile.cpp +++ b/aegisub/src/auto4_lua_assfile.cpp @@ -620,6 +620,7 @@ namespace Automation4 { AssDialogue *dia = dynamic_cast(e.get()); luaL_argcheck(L, dia, 1, "Subtitle line must be a dialogue line"); + int idx = 0; AssKaraoke kara(dia); for (AssKaraoke::iterator it = kara.begin(); it != kara.end(); ++it) { lua_newtable(L); @@ -629,7 +630,7 @@ namespace Automation4 { set_field(L, "tag", it->tag_type); set_field(L, "text", it->GetText(false)); set_field(L, "text_stripped", it->text); - lua_rawseti(L, -2, -1); + lua_rawseti(L, -2, idx++); } return 1;