-
Notifications
You must be signed in to change notification settings - Fork 0
Game state is not reset after a corrupted savegame file is loaded #981
Comments
-Kosh- commented Here is the fix so the delete routine can work correctly. |
-Kosh- uploaded file |
Per changed status from |
Per set owner to |
Per commented I'll commit it with two fixes: Using PATH_MAX instead of MAX_PATH (no idea what the latter is - does not exist here), and using sstrcpy() instead of memcpy() for strings (always use this on static destination strings). Note that saving with spaces at the end of filenames works perfectly fine here. |
Per changed status from |
Per set resolution to |
Per commented (In [8226]) Use temporary variable for manipulating filenames inside savegame function, so that original is not |
Per changed status from |
Per changed resolution from |
Per changed milestone from |
Per commented I guess this should not be quite closed yet. |
Zarel commented What's unclosed about it? The fact that it hasn't been backported to 2.3? |
-Kosh- commented Replying to Warzone2100/old-trac-import#981 (comment:5):
That and the core of the problem is not fixed. If a error pops up someplace in the load routine after it read the .gam file it is not cleaned up correctly. Here is another patch that correctly does removeWildcards() All those listed are not supported by windows according to http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx For the issue that windows people had, the name "stuff 1 " is invalid when it comes to making a directory name "stuff 1 " because of the trailing space(s). With the removeWildcards() patch, if user enters "stuff 1 " it now becomes "stuff_1____". Could have just trimmed the trailing space(s) but I opted for the easier approach. :P Whoever did removeWildcards() had a bad day it seems since that would have never worked, and it never did. |
-Kosh- uploaded file |
-Kosh- commented I forgot to ask if there was a state diagram someplace floating around ? |
anonymous commented Replying to Warzone2100/old-trac-import#981 (comment:6):
Odd, it is not showing all the underscores? It shows one underscore like "" but not multiple like "__". I guess more than one underscore is a escape sequence of some type for trac? |
Zarel commented ...yes, Like so:
|
Zarel commented And, ugh, underscores are ugly. Just get rid of trailing spaces. I will not tolerate underscores in my Warzone. D: |
Zarel commented Oh, and, you're wrong about
|
Zarel commented Oh, and in your patch, everything after |
Zarel commented I've committed a better fix for the trailing spaces in: [8227] and [8228] Is that all (other than backporting to 2.3)? |
-Kosh- commented :o I misread that code. I am really confused on what is going to be 2.3, will it be branch/2.2 or is the next version 2.2.4 and is current trunk going to be 2.5 or what? I do not think this ticket can be closed until someone figures out how to cleanup everything once that .gam file loads and it fails in another part of the loading routine. p.s why does your trac version not e-mail people when there is a reply? |
Zarel commented 2.3 is currently branches/2.2. I call it 2.3 to emphasize that the next release of branches/2.2 will be some version of 2.3. |
Buginator commented Replying to Warzone2100/old-trac-import#981 (comment:14):
You should be getting a e-mail, if not, then it is a bug. For the other stuff you mentioned, (a corrupted .gam file), this is on my TODO list, and I am adding myself to the ticket. |
vexed changed status from |
vexed changed resolution from `` to |
vexed commented Trailing spaces don't cause issues anymore. |
resolution_fixed
type_bug
| by anonymousAs is discussed here http://forums.wz2100.net/viewtopic.php?f=4&t=3889
The easy fix is to pre-screen filenames to not have spaces at the end of them eg "test 1 " Either remove trailing spaces or convert them to "test_1____". For whatever reason physfs chokes on filenames with trailing spaces before the directory specifier ("savegame/test 1 /game.map") in the PHYSFS_openWrite() call.
The more complex fix would be to keep track of each init stage and on fail call the cleanup routine for that stage.
--Kosh
Issue migrated from trac:981 at 2022-04-15 19:50:44 -0700
The text was updated successfully, but these errors were encountered: