Change the way item glow is handled
authorFreddy <schro.sb@gmail.com>
Sat, 5 Nov 2016 17:00:27 +0000 (18:00 +0100)
committerFreddy <schro.sb@gmail.com>
Sat, 5 Nov 2016 17:00:27 +0000 (18:00 +0100)
qcsrc/common/items/item.qh
qcsrc/common/items/item/powerup.qh
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh

index e46df6b..b5bf3c3 100644 (file)
@@ -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);
index 002be54..ba4de6e 100644 (file)
@@ -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;
 }
index 2b9a1f5..4f8d537 100644 (file)
@@ -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;
index 06e1455..f2308c3 100644 (file)
@@ -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);