Skip to content

Commit

Permalink
- apparently, this was broken before which is why this neeeded this c…
Browse files Browse the repository at this point in the history
…ommit in the first place, but now it's been fixed in the official distribution, which makes this commit unnecessary. Or so I am told.

Revert "make the broken ID24 levelnums work somehow so that Legacy of Rust's intermissions play."

This reverts commit 59b5676.
  • Loading branch information
madame-rachelle committed Feb 1, 2025
1 parent f21b68c commit ec8e0e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
4 changes: 0 additions & 4 deletions src/gamedata/g_mapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2409,13 +2409,9 @@ static void SetLevelNum (level_info_t *info, int num)
for (unsigned int i = 0; i < wadlevelinfos.Size(); ++i)
{
if (wadlevelinfos[i].levelnum == num)
{
wadlevelinfos[i].levelnum = 0;
wadlevelinfos[i].broken_id24_levelnum = 0;
}
}
info->levelnum = num;
info->broken_id24_levelnum = num; // at least make it work - somehow.
}

//==========================================================================
Expand Down
1 change: 0 additions & 1 deletion src/gamedata/g_mapinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ struct FExitText
struct level_info_t
{
int levelnum;
int broken_id24_levelnum;

FString MapName;
FString NextMap;
Expand Down
13 changes: 4 additions & 9 deletions src/gamedata/umapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ struct UMapEntry
char intermusic[9] = "";
int partime = 0;
int nointermission = 0;
int id24_levelnum = 0; // note that this one's semantics are massively screwed up. Only to be used for ID24-style intermissions.
};

static TArray<UMapEntry> Maps;
Expand Down Expand Up @@ -127,7 +126,7 @@ static int ParseLumpName(FScanner &scanner, char *buffer)
//
// -----------------------------------------------

static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape, int *id24_levelnum)
static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape)
{
// find the next line with content.
// this line is no property.
Expand Down Expand Up @@ -281,7 +280,6 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape, int *id24_l
epi.mEpisodeMap = mape->MapName;
epi.mPicName = split[0];
epi.mNoSkill = false;
mape->id24_levelnum = *id24_levelnum = 1;

unsigned i;
for (i = 0; i < AllEpisodes.Size(); i++)
Expand Down Expand Up @@ -352,16 +350,15 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape, int *id24_l
//
// -----------------------------------------------

static int ParseMapEntry(FScanner &scanner, UMapEntry *val, int *id24_levelnum)
static int ParseMapEntry(FScanner &scanner, UMapEntry *val)
{
scanner.MustGetToken(TK_Identifier);

val->MapName = scanner.String;
val->id24_levelnum = ++(*id24_levelnum);
scanner.MustGetToken('{');
while(!scanner.CheckToken('}'))
{
ParseStandardProperty(scanner, val, id24_levelnum);
ParseStandardProperty(scanner, val);
}
return 1;
}
Expand All @@ -377,13 +374,12 @@ int ParseUMapInfo(int lumpnum)
FScanner scanner(lumpnum);
unsigned int i;

int id24_levelnum = 1;
while (scanner.GetToken())
{
scanner.TokenMustBe(TK_Map);

UMapEntry parsed;
ParseMapEntry(scanner, &parsed, &id24_levelnum);
ParseMapEntry(scanner, &parsed);

// Endpic overrides level exits.
if (parsed.endpic[0])
Expand Down Expand Up @@ -493,7 +489,6 @@ void CommitUMapinfo(level_info_t *defaultinfo)
if (map.exitpic[0]) levelinfo->ExitPic = map.exitpic;
if (map.enteranim[0]) levelinfo->EnterAnim = map.enteranim;
if (map.exitanim[0]) levelinfo->ExitAnim = map.exitanim;
levelinfo->broken_id24_levelnum = map.id24_levelnum;
/* UMAPINFO's intermusic is for the text screen, not the summary.
if (map.intermusic[0])
{
Expand Down
4 changes: 2 additions & 2 deletions src/wi_stuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class DInterBackground : public DObject
auto* li = FindLevelInfo(state != StatCount ? wbs->next.GetChars() : wbs->current.GetChars());
if (!li)
return false;
if (li->broken_id24_levelnum != condition.param)
if (li->levelnum != condition.param)
return false;
break;
}
Expand All @@ -311,7 +311,7 @@ class DInterBackground : public DObject
auto* li = FindLevelInfo(state != StatCount ? wbs->next.GetChars() : wbs->current.GetChars());
if (!li)
return false;
if (li->broken_id24_levelnum <= condition.param)
if (li->levelnum <= condition.param)
return false;
break;
}
Expand Down

0 comments on commit ec8e0e6

Please sign in to comment.