mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Fix: IniLoadFile::LoadFromDisk expects filename but BaseMedia::AddFile provided full path (#7348)
(cherry picked from commit 04c74355ba
)
This commit is contained in:
parent
080de98c93
commit
a73ec8d386
@ -159,9 +159,9 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length,
|
|||||||
|
|
||||||
Tbase_set *set = new Tbase_set();
|
Tbase_set *set = new Tbase_set();
|
||||||
IniFile *ini = new IniFile();
|
IniFile *ini = new IniFile();
|
||||||
ini->LoadFromDisk(filename, BASESET_DIR);
|
|
||||||
|
|
||||||
char *path = stredup(filename + basepath_length);
|
char *path = stredup(filename + basepath_length);
|
||||||
|
ini->LoadFromDisk(path, BASESET_DIR);
|
||||||
|
|
||||||
char *psep = strrchr(path, PATHSEPCHAR);
|
char *psep = strrchr(path, PATHSEPCHAR);
|
||||||
if (psep != nullptr) {
|
if (psep != nullptr) {
|
||||||
psep[1] = '\0';
|
psep[1] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user