From ea2ea7dbf0fbf158424c41c2ed00d65e2738eca8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 13 May 2007 20:21:26 +0000 Subject: [PATCH] - fixed: meleethreshold only has meaning when the attacking monster actually has a melee attack. - copied a colormap fix from Skulltag. SVN r531 (trunk) --- docs/rh-log.txt | 5 +++++ src/g_level.cpp | 4 +++- src/p_enemy.cpp | 4 +--- src/v_palette.cpp | 11 ++++++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8552f09ae..50ec6b718 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +May 13, 2007 (Changes by Graf Zahl) +- fixed: meleethreshold only has meaning when the attacking monster actually + has a melee attack. +- copied a colormap fix from Skulltag. + May 12, 2007 (Changes by Graf Zahl) - Added a compatibility option to restore the original behavior of the Invisibility powerup. diff --git a/src/g_level.cpp b/src/g_level.cpp index ba6b046d4..75fd8ccc4 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2220,7 +2220,9 @@ void G_InitLevelLocals () BaseBlendA = 0.0f; // Remove underwater blend effect, if any NormalLight.Maps = realcolormaps; - NormalLight.Color = PalEntry (255, 255, 255); + //NormalLight.Color = PalEntry (255, 255, 255); + // [BB] Instead of just setting the color, we also have reset Desaturate and build the lights. + NormalLight.ChangeColor (PalEntry (255, 255, 255), 0); level.gravity = sv_gravity * 35/TICRATE; level.aircontrol = (fixed_t)(sv_aircontrol * 65536.f); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index c2ee1e4bf..6df2eaab0 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -321,13 +321,11 @@ bool AActor::SuggestMissileAttack (fixed_t dist) // new version encapsulates the different behavior in flags instead of virtual functions // The advantage is that this allows inheriting the missile attack attributes from the // various Doom monsters by custom monsters - // Making these values customizable is not necessary and in most case more confusing than - // helpful because no value here translates into anything really meaningful. if (maxtargetrange > 0 && dist > maxtargetrange) return false; // The Arch Vile's special behavior turned into a property - if (dist < meleethreshold) + if (MeleeState != NULL && dist < meleethreshold) return false; // From the Revenant: close enough for fist attack if (flags4 & MF4_MISSILEMORE) dist >>= 1; diff --git a/src/v_palette.cpp b/src/v_palette.cpp index d2fcd38a7..95f4b6699 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -759,8 +759,13 @@ void FDynamicColormap::ChangeColor (PalEntry lightcolor, int desaturate) if (lightcolor != Color || desaturate != Desaturate) { Color = lightcolor; + // [BB] desaturate must be in [0,255] + if( desaturate > 255 ) + desaturate = 255; + else if ( desaturate < 0 ) + desaturate = 0; Desaturate = desaturate; - BuildLights (); + if (Maps) BuildLights (); } } @@ -769,7 +774,7 @@ void FDynamicColormap::ChangeFade (PalEntry fadecolor) if (fadecolor != Fade) { Fade = fadecolor; - BuildLights (); + if (Maps) BuildLights (); } } @@ -779,7 +784,7 @@ void FDynamicColormap::ChangeColorFade (PalEntry lightcolor, PalEntry fadecolor) { Color = lightcolor; Fade = fadecolor; - BuildLights (); + if (Maps) BuildLights (); } }