"dir" is already used somewhere above. This was ok, but not nice.
Showing the changes to TOOLS/lua/autoload.lua (1 of 1 file). Show all
Unified · Split
| @@ -40,10 +40,10 @@ function find_and_add_entries() · 39 unmodified lines | |||
| 40 | return | 40 | return |
| 41 | end | 41 | end |
| 42 | local append = {[-1] = {}, [1] = {}} | 42 | local append = {[-1] = {}, [1] = {}} |
| 43 | for dir = -1, 1, 2 do -- 2 iterations, with dir = -1 and +1 | 43 | for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1 |
| 44 | for i = 1, MAXENTRIES do | 44 | for i = 1, MAXENTRIES do |
| 45 | local file = files[current + i * dir] | 45 | local file = files[current + i * direction] |
| 46 | local pl_e = pl[pl_current + i * dir] | 46 | local pl_e = pl[pl_current + i * direction] |
| 47 | if file == nil or file[1] == "." then | 47 | if file == nil or file[1] == "." then |
| 48 | break | 48 | break |
| 49 | end | 49 | end |
| @@ -53,7 +53,7 @@ function find_and_add_entries() · 3 unmodified lines | |||
| 53 | break | 53 | break |
| 54 | end | 54 | end |
| 55 | end | 55 | end |
| 56 | if dir == -1 then | 56 | if direction == -1 then |
| 57 | if pl_current == 1 then -- never add additional entries in the middle | 57 | if pl_current == 1 then -- never add additional entries in the middle |
| 58 | mp.msg.info("Prepending " .. file) | 58 | mp.msg.info("Prepending " .. file) |
| 59 | table.insert(append[-1], 1, file) | 59 | table.insert(append[-1], 1, file) |