]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 e46df6b3c31d8374ff0b5fc8084c84e78a5c1d64..b5bf3c361f468ff02aef5f2d834f7624e3c0aaeb 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 002be54f805a91dc9b7d56e355a695f60d589b08..ba4de6e03d2cce74b30e6406eb002d218f8c8583 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 2b9a1f5d9860c9151cf1f4c3fa8ed947b919a88f..4f8d5370fde332ca4e092a8f8c15268176d5a43d 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 06e14555ed0aca53537f9c2143ceabfc96b5b2b7..f2308c35767756933f7c9c49be74e3668d79a2f5 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);