Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Mar 4, 2025
1 parent 5480e55 commit eeb5ded
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 3 additions & 9 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,9 @@ static char *FindDehPath(char *path, const char *ext, char *pattern)

static void LoadDEHFile(char *path)
{
int i = 0;
char *dehpath;
const char *file = leafname(path);
char *dehpath = FindDehPath(path, ".bex", ".[Bb][Ee][Xx]");

if ((dehpath = FindDehPath(path, ".bex", ".[Bb][Ee][Xx]")))
if (dehpath)
{
if (!DehFileProcessed(dehpath))
{
Expand Down Expand Up @@ -1972,7 +1970,6 @@ static int D_OpenWADLauncher(void)
static void D_ProcessDehOnCmdLine(void)
{
int p = M_CheckParm("-deh");
int j = 0;

if (p || (p = M_CheckParm("-bex")))
{
Expand All @@ -1988,16 +1985,13 @@ static void D_ProcessDehOnCmdLine(void)

static void D_ProcessDehInWad(void)
{
const bool process = (!M_CheckParm("-nodeh") && !M_CheckParm("-nobex"));
int j = 0;

if (*dehwarning)
C_Warning(1, dehwarning);

if (chex1)
D_ProcessDehFile(NULL, W_GetNumForName("CHEXBEX"), true);

if (process)
if (!M_CheckParm("-nodeh") && !M_CheckParm("-nobex"))
for (int i = 0; i < numlumps; i++)
if (M_StringCompare(lumpinfo[i]->name, "DEHACKED")
&& !M_StringEndsWith(lumpinfo[i]->wadfile->path, DOOMRETRO_RESOURCEWAD))
Expand Down
11 changes: 9 additions & 2 deletions src/r_skydefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ static bool ParseSky(cJSON *json, sky_t *out)

static bool ParseFlatMap(cJSON *json, flatmap_t *out)
{
cJSON *flat = cJSON_GetObjectItemCaseSensitive(json, "flat");
cJSON *sky = cJSON_GetObjectItemCaseSensitive(json, "sky");
cJSON *flat;
cJSON *sky;

if (!cJSON_IsString((flat = cJSON_GetObjectItemCaseSensitive(json, "flat"))))
return false;

out->flat = M_StringDuplicate(flat->valuestring);

if (!cJSON_IsString((sky = cJSON_GetObjectItemCaseSensitive(json, "sky"))))
return false;

out->sky = M_StringDuplicate(sky->valuestring);
return true;
}
Expand Down

0 comments on commit eeb5ded

Please sign in to comment.