From be85acbf896f33f1fd5214e0f47385f659908b27 Mon Sep 17 00:00:00 2001 From: Freddy Date: Sat, 5 Nov 2016 18:00:27 +0100 Subject: [PATCH] Change the way item glow is handled --- qcsrc/common/items/item.qh | 1 + qcsrc/common/items/item/powerup.qh | 2 ++ qcsrc/common/t_items.qc | 6 +++--- qcsrc/common/t_items.qh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index e46df6b3c..b5bf3c361 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -45,6 +45,7 @@ CLASS(GameItem, Object) ATTRIB(GameItem, m_color, vector, '1 1 1'); ATTRIB(GameItem, m_waypoint, string); ATTRIB(GameItem, m_waypointblink, int, 1); + ATTRIB(GameItem, m_glow, bool, false); METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns)) { TC(GameItem, this); diff --git a/qcsrc/common/items/item/powerup.qh b/qcsrc/common/items/item/powerup.qh index 002be54f8..ba4de6e03 100644 --- a/qcsrc/common/items/item/powerup.qh +++ b/qcsrc/common/items/item/powerup.qh @@ -33,6 +33,7 @@ REGISTER_ITEM(Strength, Powerup) { this.m_waypoint = _("Strength"); this.m_waypointblink = 2; this.m_itemid = IT_STRENGTH; + this.m_glow = true; } #ifdef GAMEQC @@ -51,4 +52,5 @@ REGISTER_ITEM(Shield, Powerup) { this.m_waypoint = _("Shield"); this.m_waypointblink = 2; this.m_itemid = IT_INVINCIBLE; + this.m_glow = true; } diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 2b9a1f5d9..4f8d5370f 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -183,7 +183,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) if(this.ItemStatus & ITS_ALLOWFB) this.effects |= EF_FULLBRIGHT; - if(this.ItemStatus & ITS_POWERUP) + if(this.ItemStatus & ITS_GLOW) { if(this.ItemStatus & ITS_AVAILABLE) this.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); @@ -463,8 +463,8 @@ void Item_Show (entity e, float mode) e.ItemStatus &= ~ITS_AVAILABLE; }} - if (def == ITEM_Strength || def == ITEM_Shield) - e.ItemStatus |= ITS_POWERUP; + if (def.m_glow) + e.ItemStatus |= ITS_GLOW; if (autocvar_g_nodepthtestitems) e.effects |= EF_NODEPTHTEST; diff --git a/qcsrc/common/t_items.qh b/qcsrc/common/t_items.qh index 06e14555e..f2308c357 100644 --- a/qcsrc/common/t_items.qh +++ b/qcsrc/common/t_items.qh @@ -12,7 +12,7 @@ const int ISF_STATUS = BIT(3); const int ITS_AVAILABLE = BIT(3); const int ITS_ALLOWFB = BIT(4); const int ITS_ALLOWSI = BIT(5); - const int ITS_POWERUP = BIT(6); + const int ITS_GLOW = BIT(6); const int ISF_COLORMAP = BIT(4); const int ISF_DROP = BIT(5); const int ISF_ANGLES = BIT(6); -- 2.39.2