mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- fixed issues with validation of command line specified main game GRP file name.
This commit is contained in:
parent
b83928f437
commit
f40e52ab34
1 changed files with 9 additions and 4 deletions
|
@ -659,13 +659,16 @@ static TArray<GrpEntry> SetupGame()
|
||||||
{
|
{
|
||||||
for (auto& str : game)
|
for (auto& str : game)
|
||||||
{
|
{
|
||||||
|
int g = 0;
|
||||||
for (auto& grp : groups)
|
for (auto& grp : groups)
|
||||||
{
|
{
|
||||||
if (grp.FileInfo.gameid.CompareNoCase(str) == 0)
|
if (grp.FileInfo.gameid.CompareNoCase(str) == 0)
|
||||||
{
|
{
|
||||||
userConfig.gamegrp = grp.FileName;
|
userConfig.gamegrp = grp.FileName;
|
||||||
|
groupno = g;
|
||||||
goto foundit;
|
goto foundit;
|
||||||
}
|
}
|
||||||
|
g++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -673,16 +676,18 @@ static TArray<GrpEntry> SetupGame()
|
||||||
|
|
||||||
// If the user has specified a file name, let's see if we know it.
|
// If the user has specified a file name, let's see if we know it.
|
||||||
//
|
//
|
||||||
if (userConfig.gamegrp.Len())
|
if (groupno == -1 && userConfig.gamegrp.Len())
|
||||||
{
|
{
|
||||||
FString gamegrplower = "/" + userConfig.gamegrp.MakeLower();
|
FString gamegrplower = userConfig.gamegrp.MakeLower();
|
||||||
|
if (gamegrplower[1] != ':' || gamegrplower[2] != '/') gamegrplower.Insert(0, "/");
|
||||||
|
|
||||||
int g = 0;
|
int g = 0;
|
||||||
for (auto& grp : groups)
|
for (auto& grp : groups)
|
||||||
{
|
{
|
||||||
auto grplower = grp.FileName.MakeLower();
|
auto grplower = grp.FileName.MakeLower();
|
||||||
grplower.Substitute("\\", "/");
|
FixPathSeperator(grplower);
|
||||||
if (grplower.LastIndexOf(gamegrplower) == grplower.Len() - gamegrplower.Len())
|
int pos = grplower.LastIndexOf(gamegrplower);
|
||||||
|
if (pos >= 0 && pos == grplower.Len() - gamegrplower.Len())
|
||||||
{
|
{
|
||||||
groupno = g;
|
groupno = g;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue