Commit f56b94b5 authored by terencehill's avatar terencehill

Fix Large Armor and Mega Health detection in Quake / Quake 3 maps. Fixes...

Fix Large Armor and Mega Health detection in Quake / Quake 3 maps. Fixes issues in itemstime, superspec, instagib and lms.
parent 5670fc6a
......@@ -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;
......
......@@ -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();
......
......@@ -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))
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment