]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix Large Armor and Mega Health detection in Quake / Quake 3 maps. Fixes issues in...
authorterencehill <piuntn@gmail.com>
Wed, 19 Aug 2015 12:44:42 +0000 (14:44 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 19 Aug 2015 12:44:42 +0000 (14:44 +0200)
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/t_items.qc

index 61e51451fbaf9d354407568d20706a92b857fa5a..9c97c7cd2f2695bd6ade537fe1835f0412454b14 100644 (file)
@@ -158,7 +158,7 @@ MUTATOR_HOOKFUNCTION(lms_KeepScore)
 MUTATOR_HOOKFUNCTION(lms_FilterItem)
 {
        if(autocvar_g_lms_extra_lives)
-       if(self.classname == "item_health_mega")
+       if(self.itemdef == ITEM_HealthMega)
        {
                self.max_health = 1;
                return false;
index 9e4727d8d1f1ae39fd0af4d58a6f0e6cbee62948..b71a8c9c72e3b11a6fa5c4eded799436e18c43cb 100644 (file)
@@ -405,7 +405,7 @@ MUTATOR_HOOKFUNCTION(instagib_ItemTouch)
 MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn)
 {
        if (!autocvar_g_powerups) { return false; }
-       if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega"))
+       if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.itemdef == ITEM_HealthMega))
                return false;
 
        entity e = spawn();
index 3570e220431d531d437b60aff61de4aab2899c3e..267a0f71da0fa390f543015f7b5305754b8ee5e0 100644 (file)
@@ -122,10 +122,10 @@ MUTATOR_HOOKFUNCTION(superspec_ItemTouch)
                        }
 
                if((self.autospec_flags & ASF_SHIELD && _item.invincible_finished) ||
-                               (self.autospec_flags & ASF_STRENGTH && _item.strength_finished) ||
-                               (self.autospec_flags & ASF_MEGA_AR && _item.classname == "item_armor_large") ||
-                               (self.autospec_flags & ASF_MEGA_HP && _item.classname == "item_health_mega") ||
-                               (self.autospec_flags & ASF_FLAG_GRAB && _item.classname == "item_flag_team"))
+                       (self.autospec_flags & ASF_STRENGTH && _item.strength_finished) ||
+                       (self.autospec_flags & ASF_MEGA_AR && _item.itemdef == ITEM_ArmorLarge) ||
+                       (self.autospec_flags & ASF_MEGA_HP && _item.itemdef == ITEM_HealthMega) ||
+                       (self.autospec_flags & ASF_FLAG_GRAB && _item.classname == "item_flag_team"))
                {
 
                        if((self.enemy != other) || IS_OBSERVER(self))
index 873f7a53c1f89159e32534626b6609221d15bd23..b41cc107fbb5f509f3f4158b94572ca2f865ed1a 100644 (file)
@@ -501,11 +501,11 @@ void Item_ItemsTime_SetTime(entity e, float t)
                switch(e.items)
                {
                        case IT_HEALTH:
-                               // if(e.classname == "item_health_mega") // IT_HEALTH unequivocally identifies it
+                               // if(e.itemdef == ITEM_MegaHealth) // e.items == IT_HEALTH unequivocally identifies it
                                        it_health_mega_time = t;
                                break;
                        case IT_ARMOR:
-                               if(e.classname == "item_armor_large") // IT_ARMOR doesn't unequivocally identifies it
+                               if(e.itemdef == ITEM_ArmorLarge) // e.items == IT_ARMOR doesn't unequivocally identifies it
                                        it_armor_large_time = t;
                                break;
                        case IT_STRENGTH://"item-strength"
@@ -598,7 +598,7 @@ void Item_Respawn (void)
                sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
        setorigin (self, self.origin);
 
-       if(self.flags & FL_POWERUP || self.classname == "item_armor_large" || self.items == IT_HEALTH || (self.weapons & WEPSET_SUPERWEAPONS))
+       if(self.flags & FL_POWERUP || self.itemdef == ITEM_ArmorLarge || self.items == IT_HEALTH || (self.weapons & WEPSET_SUPERWEAPONS))
        {
                float t = Item_ItemsTime_UpdateTime(self, 0);
                Item_ItemsTime_SetTime(self, t);
@@ -636,11 +636,11 @@ void Item_RespawnCountdown (void)
                                case IT_STRENGTH:   name = "item-strength"; rgb = '0 0 1'; break;
                                case IT_INVINCIBLE: name = "item-shield"; rgb = '1 0 1'; break;
                                case IT_HEALTH:
-                                       //if (self.classname == "item_health_mega")
+                                       // if(self.itemdef == ITEM_HealthMega)
                                                {name = "item_health_mega"; rgb = '1 0 0';}
                                        break;
                                case IT_ARMOR:
-                                       if (self.classname == "item_armor_large")
+                                       if(self.itemdef == ITEM_ArmorLarge)
                                                {name = "item_armor_large"; rgb = '0 1 0';}
                                        break;
                        }
@@ -711,7 +711,7 @@ void Item_RespawnThink()
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS) || e.classname == "item_armor_large" || e.items == IT_HEALTH)
+       if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS) || e.itemdef == ITEM_ArmorLarge || e.items == IT_HEALTH)
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);