mirror of https://github.com/odrling/Aegisub
Fix backwards-compatibilty break in the lua karaoke parser
Insert an empty syllable at the beginning of the karaoke syllable table to better mimick 2.1.x's behavior. Originally committed to SVN as r6369.
This commit is contained in:
parent
0aec0a9d59
commit
d55f1622f1
|
@ -635,6 +635,19 @@ namespace Automation4 {
|
|||
luaL_argcheck(L, dia, 1, "Subtitle line must be a dialogue line");
|
||||
|
||||
int idx = 0;
|
||||
|
||||
// 2.1.x stored everything before the first syllable at index zero
|
||||
// There's no longer any such thing with the new parser, but scripts
|
||||
// may rely on kara[0] existing so add an empty syllable
|
||||
lua_newtable(L);
|
||||
set_field(L, "duration", 0);
|
||||
set_field(L, "start_time", dia->Start);
|
||||
set_field(L, "end_time", dia->Start);
|
||||
set_field(L, "tag", "");
|
||||
set_field(L, "text", "");
|
||||
set_field(L, "text_stripped", "");
|
||||
lua_rawseti(L, -2, idx++);
|
||||
|
||||
AssKaraoke kara(dia);
|
||||
for (AssKaraoke::iterator it = kara.begin(); it != kara.end(); ++it) {
|
||||
lua_newtable(L);
|
||||
|
|
Loading…
Reference in New Issue