View Issue Details

IDProjectCategoryView StatusLast Update
0003609The Dark ModTweakingpublic26.05.2014 20:26
Reportergnartsch Assigned Totaaaki  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.00 
Target VersionTDM 2.02Fixed in VersionTDM 2.02 
Summary0003609: TDM crashes on startup if fms folder does not exist
DescriptionIn case the fms folder does not exist, TDM will crash on startup.
Instead TDM should tell the player that it could not find the fms folder, or even better, simply create it without asking.

When 2.0 was announced, people were asked to drop the entire fms folder in order to get rid of old missions.
The result for me was that TDM would simply crash and leaving it up to me figuring out what was going wrong.
Steps To Reproduce- delete the fms folder
- start TDM
--> crash to desktop
TagsNo tags attached.

Relationships

related to 0003351 resolvedtaaaki Game crashes on load if no FM in fms folder. 

Activities

Springheel

Springheel

20.11.2013 01:28

administrator   ~0006244

Last edited: 20.11.2013 01:29

You should delete the folder before updating, not after. Otherwise you lose the Training Mission and St. Lucia.

Still would be nice if it gave a reason for the crash though.

gnartsch

gnartsch

20.11.2013 23:39

reporter   ~0006251

Last edited: 21.11.2013 23:18

Yeah, you are right about the sequence of deleting the fms folder.
But you know how precise the instructions sometimes are and how well players read them. :-)

Fixing the crashes is the easy part:

In CMissionManager::SearchForNewMods() ~line 320
and CMissionManager::GenerateModList() ~line 448
there are iterators over directories.

Adding the following code in those two methods right after the respective intial DM_LOG entry will fix the crashes.
Actually it forces a shutdown of TDM and prevents the player to continue to the download menu or some other place, which would not make any sense, since downloads would fail anyway.

    if (!fs::is_directory(fmPath))
    {
        DM_LOG(LC_MAINMENU, LT_ERROR)LOGSTRING("FM root folder does not exist: %s\r", fmPath.string().c_str());
        gameLocal.Error("FM root folder does not exist: %s\rRun the tdm_update in order to restore it.\r", fmPath.string().c_str());
        return XXX;
    }

TDM would then exit with a console window as seen below.

http://www.gnartsch.de/Thief-FM/beta/darkmod/FixFmsFolderMissing.jpg

Of course some nice dialog with an explicit message would be better, but that seems out of scope of the gamex86.dll and therefor nothing I could debug.
That console window is better then a crash anyways, since the gamma on my screen stays pretty high after a crash... and sometimes TDM is not really willing to die (and needs the CTRL-ALT-DEL salute despite of having crashed already).

taaaki

taaaki

11.12.2013 10:33

administrator   ~0006316

Hmmmm, this was meant to be fixed in some changes quite a while back. Let me dig into this a bit more.
taaaki

taaaki

09.05.2014 22:16

administrator   ~0006597

Last edited: 09.05.2014 22:16

Hopefully the final time that I have to claim to have fixed the missing "fms" folder issue. darkmod_src r5992
 
Previous fixes missed the case where both the fms folder and the currentfm.txt file are missing (e.g. fresh install where the fms folder wasn't created correctly or was removed for some reason).

I will likely implement further checks in the game code to ensure that TDM doesn't crash if the fms folder is removed after TDM has been started (the current fix only does the check at game startup).

taaaki

taaaki

26.05.2014 20:26

administrator   ~0006639

Implemented extra error checking for missing "fms" directory based on gnartsch's suggestion. I think there are sufficient checks for this now, finally.

darkmod_src r6018.

Issue History

Date Modified Username Field Change
19.11.2013 22:54 gnartsch New Issue
20.11.2013 01:28 Springheel Note Added: 0006244
20.11.2013 01:29 Springheel Note Edited: 0006244
20.11.2013 23:39 gnartsch Note Added: 0006251
20.11.2013 23:46 gnartsch Note Edited: 0006251
21.11.2013 23:18 gnartsch Note Edited: 0006251
11.12.2013 10:33 taaaki Note Added: 0006316
11.12.2013 10:44 taaaki Relationship added related to 0003351
22.01.2014 20:30 taaaki Assigned To => taaaki
22.01.2014 20:30 taaaki Status new => assigned
09.05.2014 22:16 taaaki Note Added: 0006597
09.05.2014 22:16 taaaki Status assigned => feedback
09.05.2014 22:16 taaaki Note Edited: 0006597
09.05.2014 22:17 taaaki Target Version => TDM 2.02
26.05.2014 20:26 taaaki Note Added: 0006639
26.05.2014 20:26 taaaki Status feedback => resolved
26.05.2014 20:26 taaaki Fixed in Version => TDM 2.02
26.05.2014 20:26 taaaki Resolution open => fixed