Write mod data correctly. Fixes #1940.
- The comment is wrong https://wildfiregames.com/forum/index.php?/topic/25579-cannot-play-custom-maps-please-help/&do=findComment&comment=371878
- We may want to reconsider whether the feature design is ideal. From https://trac.wildfiregames.com/ticket/1940#comment:3
I don't really like the inconsistency in the dev and non-dev cases, in terms of mounting the read-only and user-writable mods
This surprise has resulted in problems before, for example for mod-version checks that have to hardcode a "user" exclusion.
- The special "user" mod behavior is not documented anywhere other than being buried in the middle of a C++ code file.
- One may reconsider whether it is actually necessary to write to a "user/" mod folder instead of a "public/" folder, i.e. whether adding a "user" mod was necessary to begin with and not adding a solution for the right problem in the wrong level of the code.
Oh..that one specific word. Yes, it is incorrect. Incorrect like a typo in my opinion. If you are only reading the comment and not the code relating to it, you are doing something wrong.
It's precisely because I read the code relating to it that I noticed the comment to be slightly incorrect and lacking explanation as to why the code is doing what it does. The purpose of comments is to (1) summarize the code behavior and (2) state the reasons behind the code behavior.
The first of these four points typo-grade indeed.
That is what the code does, but not a reason as to why it should do that.
From the two trac tickets, it seems this was only done to address one single error stack:
So that was the historic stack trace that needed to be fixed and _not_ any further design decision, at least not printed anywhere, not in the code, not in the two tickets. The only thing we find in the ticket is someone claiming that he thinks that precisely the different behavior for release-code and dev code is more bothersome than desirable and is recommended for revision.
There are a number of solutions, they should all be evaluated without prejudice before rushing one solution, or we should at least be able to later reevaluate instead of claiming a temporary fix to be the obvious best solution.
I mentioned the alternative on the forums already: .local/share/0ad/mods/public/ instead of .local/share/0ad/mods/user/,
The solution would have the following advantages over the existing: