Skip to content

Commit

Permalink
- restrict lookup of engine/engine.def to the main game files.
Browse files Browse the repository at this point in the history
Mods should not use this to load their data.
  • Loading branch information
coelckers committed Jun 9, 2021
1 parent 9d36e61 commit 1cea743
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/core/defparser.cpp
Expand Up @@ -2116,7 +2116,7 @@ static void defsparser(FScanner& sc)
}
}

void loaddefinitionsfile(const char* fn, bool cumulative)
void loaddefinitionsfile(const char* fn, bool cumulative, bool maingame)
{
bool done = false;
auto parseit = [&](int lump)
Expand Down Expand Up @@ -2154,6 +2154,7 @@ void loaddefinitionsfile(const char* fn, bool cumulative)
int lump, lastlump = 0;
while ((lump = fileSystem.FindLumpFullName(fn, &lastlump)) >= 0)
{
if (maingame && fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum()) break;
Printf(PRINT_NONOTIFY, "Loading \"%s\"\n", fileSystem.GetFileFullPath(lump).GetChars());
deftimer.Clock();
parseit(lump);
Expand Down
2 changes: 1 addition & 1 deletion source/core/gamecontrol.cpp
Expand Up @@ -1411,7 +1411,7 @@ void LoadDefinitions()
FString razedefsfile = defsfile;
razedefsfile.Substitute(".def", "-raze.def");

loaddefinitionsfile("engine/engine.def"); // Internal stuff that is required.
loaddefinitionsfile("engine/engine.def", true, true); // Internal stuff that is required.

// check what we have.
// user .defs override the default ones and are not cumulative.
Expand Down
2 changes: 1 addition & 1 deletion source/core/gamefuncs.h
Expand Up @@ -6,7 +6,7 @@

extern int cameradist, cameraclock;

void loaddefinitionsfile(const char* fn, bool cumulative = false);
void loaddefinitionsfile(const char* fn, bool cumulative = false, bool maingrp = false);

bool calcChaseCamPos(int* px, int* py, int* pz, spritetype* pspr, short *psectnum, binangle ang, fixedhoriz horiz, double const smoothratio);
void PlanesAtPoint(const sectortype* sec, int dax, int day, float* ceilz, float* florz);
Expand Down

0 comments on commit 1cea743

Please sign in to comment.