Skip to content
Extraits de code Groupes Projets
Valider 51616fea rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

Add tenv.maxj (upper loop bound)

Originally committed to SVN as r1564.
parent 86fad7d3
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -444,6 +444,7 @@ function apply_line(meta, styles, subs, line, templates, tenv) ...@@ -444,6 +444,7 @@ function apply_line(meta, styles, subs, line, templates, tenv)
aegisub.debug.out(5, "Running line templates\n") aegisub.debug.out(5, "Running line templates\n")
for t in matching_templates(templates.line, line, tenv) do for t in matching_templates(templates.line, line, tenv) do
tenv.j = 0 tenv.j = 0
tenv.maxj = t.loops
while tenv.j < t.loops do while tenv.j < t.loops do
tenv.j = tenv.j + 1 tenv.j = tenv.j + 1
if t.code then if t.code then
...@@ -519,6 +520,7 @@ function run_code_template(template, tenv) ...@@ -519,6 +520,7 @@ function run_code_template(template, tenv)
else else
local pcall = pcall local pcall = pcall
setfenv(f, tenv) setfenv(f, tenv)
tenv.maxj = template.loops
for j = 1, template.loops do for j = 1, template.loops do
tenv.j = j tenv.j = j
local res, err = pcall(f) local res, err = pcall(f)
...@@ -676,6 +678,7 @@ function apply_one_syllable_template(syl, line, template, tenv, varctx, subs, sk ...@@ -676,6 +678,7 @@ function apply_one_syllable_template(syl, line, template, tenv, varctx, subs, sk
run_code_template(t, tenv) run_code_template(t, tenv)
else else
aegisub.debug.out(5, "Running %d effect loops\n", t.loops) aegisub.debug.out(5, "Running %d effect loops\n", t.loops)
tenv.maxj = t.loops
for j = 1, t.loops do for j = 1, t.loops do
tenv.j = j tenv.j = j
local newline = table.copy(line) local newline = table.copy(line)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter