From 3fc0deb0bcc1d870d9d697571648bc197e5ecb53 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 17 Nov 2024 13:59:38 +0100 Subject: [PATCH] well was worth a try lol --- src/p_setup.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index f869e6904..5eb0c714a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -322,15 +322,19 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) // SRB2Kart //mapheaderinfo[num]->automap = false; mapheaderinfo[num]->mobj_scale = FRACUNIT; - mapheaderinfo[num]->light_contrast = M_RandomRange(0, 58); - mapheaderinfo[num]->sprite_backlight = 0; - mapheaderinfo[num]->use_light_angle = true; - mapheaderinfo[num]->light_angle = M_RandomRange(-382, 382); // an even further impossibility, delfile custom opts support mapheaderinfo[num]->customopts = NULL; mapheaderinfo[num]->numCustomOptions = 0; } +static void P_ClearDirectionalLightMapHeaderInfo(INT16 i) // lol dont always reset this on every map load +{ + mapheaderinfo[i]->light_contrast = M_RandomRange(0, 58); + mapheaderinfo[i]->sprite_backlight = 0; + mapheaderinfo[i]->use_light_angle = true; + mapheaderinfo[i]->light_angle = M_RandomRange(-382, 382); +} + /** Allocates a new map-header structure. * * \param i Index of header to allocate. @@ -341,8 +345,9 @@ void P_AllocMapHeader(INT16 i) { mapheaderinfo[i] = Z_Malloc(sizeof(mapheader_t), PU_STATIC, NULL); mapheaderinfo[i]->grades = NULL; - P_ClearSingleMapHeaderInfo(i + 1); + P_ClearDirectionalLightMapHeaderInfo(i); } + P_ClearSingleMapHeaderInfo(i + 1); } // Loads the vertexes for a level.