Files
fs2open.github.com/code
Tom Crayford f7f537ff77 fix mod loading errors on non windows
When running a mod on non-windows, that isn't packed into VP files, the
mod can break when loading. On non-windows filesystems, the file
order isn't guaranteed to be alphabetical (but it is on Windows).
As a result, we load tables in an effectively random order.

Lots of mods rely on the filesystem ordering to e.g. implement a very
loose dependency system for their lua scripts.

Referenced on the forum here:
https://www.hard-light.net/forums/index.php?topic=95750.msg1885275#msg1885275

Here's a log from Solaris failing to run:

https://fsnebula.org/log/5d7b4414cb0d332b466b5ee2#True-138

Instead, always sort filesystem listing by name *before* applying the
provided sort order.

I've built a few different versions of this patch, and like this one the
best. The other ones I tried:
1. Adding a `CF_SORT_REVERSE_NAME` and using it everywhere that
`CF_SORT_REVERSE` is used, and replacing all uses of `CF_SORT_NONE` with
`CF_SORT_NAME`. I didn't like this as it was a much larger diff.
2. Adding a `CF_SORT_REVERSE_NAME` to the `scripting.cpp` call for
loading tables. I didn't like this one because this bug can in theory
impact non scripting tables.

Here's a log from Solaris working with the new build:
https://fsnebula.org/log/5d7b4f37cb0d332b3d6b5ed3#True-138

While it might be a reasonable enhancement in the future to build a proper dependency system for lua scripts and tables,
this is a much smaller and easier change, and doesn't require any work from modders.
2019-09-13 17:22:15 +02:00
..
2019-07-30 17:58:52 -04:00
2018-12-22 20:10:56 +01:00
2019-05-01 09:44:19 +02:00
2019-03-02 14:02:21 +01:00
2019-06-30 13:28:05 +02:00
2019-02-26 19:53:11 +01:00
2016-08-10 13:33:12 +02:00
2019-05-01 09:44:19 +02:00
2019-06-30 13:28:05 +02:00
2018-07-15 19:37:24 +02:00
2019-03-02 14:02:21 +01:00
2019-02-26 19:53:11 +01:00
2019-06-30 13:28:05 +02:00
2019-07-04 10:14:07 -04:00
2019-09-03 19:53:04 +02:00
2019-07-20 16:12:45 -04:00
2019-03-02 14:02:21 +01:00
2018-11-22 16:07:00 -05:00
2019-07-27 21:21:33 -04:00
2019-06-25 17:17:02 -04:00
2016-08-12 16:13:50 -07:00
2019-03-02 14:02:21 +01:00
2019-07-19 09:11:14 -04:00
2019-07-29 21:25:50 -04:00
2018-04-25 11:57:55 +02:00
2019-03-10 09:26:12 +10:00
2019-05-24 13:43:04 -07:00
2018-12-29 16:41:23 +01:00
2016-07-22 12:07:19 +02:00
2019-03-02 14:02:21 +01:00
2019-05-24 13:43:04 -07:00
2018-04-25 11:57:55 +02:00
2019-06-30 13:28:05 +02:00
2018-04-25 11:57:55 +02:00
2018-09-16 13:55:29 +02:00
2016-07-22 12:07:19 +02:00