mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Cap lightlevel fading at spawn_lightlevel (don't make darker)
This commit is contained in:
parent
c3c4a251f1
commit
43ae628adc
1 changed files with 1 additions and 1 deletions
|
@ -7769,7 +7769,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor
|
||||||
if (dolighting && !(rover->flags & FF_NOSHADE))
|
if (dolighting && !(rover->flags & FF_NOSHADE))
|
||||||
{
|
{
|
||||||
UINT16 lightdelta = abs(sectors[rover->secnum].spawn_lightlevel - rover->target->lightlevel);
|
UINT16 lightdelta = abs(sectors[rover->secnum].spawn_lightlevel - rover->target->lightlevel);
|
||||||
fixed_t alphapercent = FixedDiv(d->destvalue, rover->spawnalpha);
|
fixed_t alphapercent = min(FixedDiv(d->destvalue, rover->spawnalpha), 1*FRACUNIT); // don't make darker than spawn_lightlevel
|
||||||
fixed_t adjustedlightdelta = FixedMul(lightdelta, alphapercent);
|
fixed_t adjustedlightdelta = FixedMul(lightdelta, alphapercent);
|
||||||
|
|
||||||
if (rover->target->lightlevel >= sectors[rover->secnum].spawn_lightlevel) // fading out, get lighter
|
if (rover->target->lightlevel >= sectors[rover->secnum].spawn_lightlevel) // fading out, get lighter
|
||||||
|
|
Loading…
Reference in a new issue