Make the karaoke syllable table from aegisub.parse_karaoke_data zero-based for backward compatibility

Originally committed to SVN as r5694.
This commit is contained in:
Thomas Goyne 2011-09-30 20:42:09 +00:00
parent 5c75c9f708
commit 3776051f96

View file

@ -620,6 +620,7 @@ namespace Automation4 {
AssDialogue *dia = dynamic_cast<AssDialogue*>(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;