1
0
forked from 0ad/0ad
0ad/source
wraitii d740b4f335 Fix bug where 'archive' XMB files could end up being written to the user mod
Users sometimes ended up with bad (wrong version) XMB files in the user
mod. This resulted in A25 loading a black screen.
There is a combination of unfortunate code paths that lead to this. The
core issue is that:
- cdd75deafb changed the XMB loading code that if there is an error in
Init from a cached XMB, it reports an error. This error happens to be
silent, because the GUI expects CXeromyces to do its own error reporting
(a pretty poor decision, all in all, but whatever). This explained why
the black screen showed no errors.
- The code flow attemps to load an 'archive' XMB first, then only a
loose cache. _But_ if the XMB that fails to load is an archive (which
generally never happens except when using incompatible mods, which is
generally less easy in A25 since we added code to stop that), then the
game will try to recreate the XMB as an 'archived' path, not a 'loose
cache' path as it would usually do.
- Because the 'archived' path already exists in the VFS, the game will
attempt to overwrite that. It so happens that in non-dev copies, this
writes to the user mod.
- Because the user-mod is always loaded, this was unexpected for users.

Fixing this is rather simple: the game should never attempt to write
'archive' XMBs in that function. Added explicit barrier, which shouldn't
matter performance-wise but fixes the issue by writing in the proper
place, and also properly recovering in case of read failure.
I will note that the game will still try to load the archived file, and
recreate it every time, but I don't think that's a particularly big
deal, in general having engine-incompatible mods in the future should be
harder because of A25 changes there.
(NB: users that have used both A24 and A25 should perhaps still be
advised to check their user mod folder, otherwise they'll end up
recreating those files forever).

Reported by: dave_k
Fixes #6320

Differential Revision: https://code.wildfiregames.com/D4275
This was SVN commit r26272.
2022-01-30 12:50:43 +00:00
..
collada Forbids using more than 64 bones for GPU skinning. 2021-12-13 19:22:27 +00:00
graphics Call SetTerrainDirty on CModelAbstract without going through CmpVisualActor 2022-01-29 08:28:04 +00:00
gui Fix bug where 'archive' XMB files could end up being written to the user mod 2022-01-30 12:50:43 +00:00
i18n Split ScriptRequest in its own header. 2021-05-03 16:07:26 +00:00
lib Uses MIPs for terrain textures previews following e4455a8e8f. 2022-01-24 07:00:55 +00:00
lobby Adds std namespace to shared_ptr usages in network and engine. 2021-05-22 19:28:40 +00:00
maths UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
mocks More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
network Remove leftover terrain-based movement cost code. 2022-01-29 08:22:28 +00:00
pch Include CStrInternStatic where necessary only. 2021-05-18 11:09:54 +00:00
ps Fix bug where 'archive' XMB files could end up being written to the user mod 2022-01-30 12:50:43 +00:00
renderer Remove leftover terrain-based movement cost code. 2022-01-29 08:22:28 +00:00
rlinterface Split off JSON-related function from ScriptInterface, clean up headers. 2021-05-14 10:18:03 +00:00
scriptinterface Remove JS_New in favour of JS::Construct in preparation for SM91 2022-01-12 16:51:32 +00:00
simulation2 Call SetTerrainDirty on CModelAbstract without going through CmpVisualActor 2022-01-29 08:28:04 +00:00
soundmanager Removes mentions of legacy and unused GL calls, unifies AsFloatArray. 2021-10-11 12:39:01 +00:00
third_party Optimization for include resolving in PreprocessorWrapper. 2021-01-20 23:05:15 +00:00
tools Call SetTerrainDirty on CModelAbstract without going through CmpVisualActor 2022-01-29 08:28:04 +00:00
main.cpp Allow to cap FPS up to the current max refresh rates of gaming screens: 360Hz 2022-01-13 14:30:23 +00:00
test_setup.cpp Implement a global task manager using a pool of worker threads 2021-06-03 14:48:38 +00:00