REGoth-project / REGoth

OpenSource-Reimplementation of the zEngine, used by the game "Gothic"
GNU General Public License v3.0
628 stars 63 forks source link

Fix engine always trying to load OU.BIN instead of OU.DAT in case it doesn't exist #348

Closed frabert closed 6 years ago

frabert commented 6 years ago

I have always been experiencing this on my desktop but not on my laptop, for some reason Utils::getCaseSensitivePath returns a valid path even for nonexistant files, so the engine would always try to load OU.BIN instead of OU.DAT on desktop, making the game crash every time I start a dialog with an NPC

ataulien commented 6 years ago

Would you add the check to Utils::getCaseSensitivePath, too?

frabert commented 6 years ago

You mean checking for file existance inside of getCaseSensitivePath?

ataulien commented 6 years ago

That function should probably return something like an empty string for files that don't exist.

frabert commented 6 years ago

Done, turns out the function was trying to be smart on Windows by exploiting the fact that the filesystem is case-insensitive to begin with, there