Skip to content

Commit

Permalink
Load all dsdahud lumps
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Dec 1, 2023
1 parent 6e27672 commit 886c710
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions prboom2/src/dsda/exhud.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,18 @@ static void dsda_LoadHUDConfig(void) {
if (arg->found)
length = M_ReadFileToString(arg->value.v_string, &hud_config);

lump = W_GetNumForName("DSDAHUD");

if (lump != -1) {
if (!hud_config)
lump = -1;
while ((lump = W_FindNumFromName("DSDAHUD", lump)) >= 0) {
if (!hud_config) {
hud_config = W_ReadLumpToString(lump);
length = W_LumpLength(lump);
}
else {
hud_config = Z_Realloc(hud_config, length + W_LumpLength(lump) + 2);
hud_config[length++] = '\n'; // in case the file didn't end in a new line
W_ReadLump(lump, hud_config + length);
hud_config[length + W_LumpLength(lump)] = '\0';
length += W_LumpLength(lump);
hud_config[length] = '\0';
}
}

Expand Down

0 comments on commit 886c710

Please sign in to comment.