Merge pull request #594 from khokh2001/warp

Emulation of hidden par bug in Final Doom.
This commit is contained in:
Simon Howard 2015-11-08 19:22:48 -05:00
commit 74e95c6130
3 changed files with 63 additions and 29 deletions

View file

@ -1726,9 +1726,6 @@ G_InitNew
// the -warp command line parameter to behave differently.
// This is left here for posterity.
if (skill > sk_nightmare)
skill = sk_nightmare;
// This was quite messy with SPECIAL and commented parts.
// Supposedly hacks to make the latest edition work.
// It might not work properly.
@ -1752,6 +1749,33 @@ G_InitNew
}
*/
if (skill > sk_nightmare)
skill = sk_nightmare;
if (gameversion >= exe_ultimate)
{
if (episode == 0)
{
episode = 4;
}
}
else
{
if (episode < 1)
{
episode = 1;
}
if (episode > 3)
{
episode = 3;
}
}
if (episode > 1 && gamemode == shareware)
{
episode = 1;
}
if (map < 1)
map = 1;

View file

@ -611,7 +611,7 @@ ST_Responder (event_t* ev)
if (gamemode == commercial)
{
epsd = 1;
epsd = 0;
map = (buf[0] - '0')*10 + buf[1] - '0';
}
else
@ -635,30 +635,40 @@ ST_Responder (event_t* ev)
}
// Catch invalid maps.
if (epsd < 1)
return false;
if (map < 1)
return false;
// Ohmygod - this is not going to work.
if ((gamemode == retail)
&& ((epsd > 4) || (map > 9)))
return false;
if ((gamemode == registered)
&& ((epsd > 3) || (map > 9)))
return false;
if ((gamemode == shareware)
&& ((epsd > 1) || (map > 9)))
return false;
// The source release has this check as map > 34. However, Vanilla
// Doom allows IDCLEV up to MAP40 even though it normally crashes.
if ((gamemode == commercial)
&& (( epsd > 1) || (map > 40)))
return false;
if (gamemode != commercial)
{
if (epsd < 1)
{
return false;
}
if (epsd > 4)
{
return false;
}
if (epsd == 4 && gameversion < exe_ultimate)
{
return false;
}
if (map < 1)
{
return false;
}
if (map > 9)
{
return false;
}
}
else
{
if (map < 1)
{
return false;
}
if (map > 40)
{
return false;
}
}
// So be it.
plyr->message = DEH_String(STSTR_CLEV);

View file

@ -1810,7 +1810,7 @@ void WI_initVariables(wbstartstruct_t* wbstartstruct)
if (!wbs->maxsecret)
wbs->maxsecret = 1;
if ( gamemode != retail )
if ( gameversion < exe_ultimate )
if (wbs->epsd > 2)
wbs->epsd -= 3;
}