From fbe14d59bba9f82a3f8968861a813553ecce3752 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 3 Dec 2014 13:05:50 +0100 Subject: [PATCH] - fixed: All powerup blend colors with an alpha of 0 were treated as 'has no color' for PowerupGivers. --- src/g_shared/a_artifacts.cpp | 3 ++- src/thingdef/thingdef_properties.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 4a2d066cd..410474f31 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -60,7 +60,8 @@ bool APowerupGiver::Use (bool pickup) } if (BlendColor != 0) { - power->BlendColor = BlendColor; + if (BlendColor.a != 0) power->BlendColor = BlendColor; + else power->BlendColor = 0; } if (Mode != NAME_None) { diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index b5fdc8e42..ec68dfb95 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2020,15 +2020,18 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) "INVERSEMAP", "GOLDMAP", "REDMAP", "GREENMAP", "BLUEMAP", NULL }; int alpha; + bool giver; PalEntry * pBlendColor; if (info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup))) { pBlendColor = &((APowerup*)defaults)->BlendColor; + giver = false; } else if (info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver))) { pBlendColor = &((APowerupGiver*)defaults)->BlendColor; + giver = true; } else { @@ -2061,7 +2064,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) else alpha = 255/3; alpha=clamp(alpha, 0, 255); - if (alpha != 0) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color; + if (alpha != 0 || giver) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color; else *pBlendColor = 0; }