From: terencehill Date: Thu, 6 Aug 2015 21:12:28 +0000 (+0200) Subject: Remove some code that now is useless X-Git-Tag: xonotic-v0.8.1~12^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=303c73cf1770d69b51cf58939f6ed6ad54198413;p=xonotic%2Fxonotic-data.pk3dir.git Remove some code that now is useless --- diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index d4ae97ea8..0f35eea87 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -475,16 +475,7 @@ void Item_ItemsTime_SetTimesForPlayer(entity e) e.item_jetpack_time = it_jetpack_time; e.item_superweapons_time = it_superweapons_time; } -bool Item_ItemsTime_UpdateTime_Check(float item_time, float t) -{ - if(t == 0 && item_time == -1) - return true; - if(t < 0) // negative means there's another available item of the same kind - t = -t; - if(time < t && (item_time <= time || t < item_time)) - return true; - return false; -} + void Item_ItemsTime_UpdateTime(entity e, float t) { if(!autocvar_sv_itemstime) @@ -495,16 +486,13 @@ void Item_ItemsTime_UpdateTime(entity e, float t) switch(e.items) { case IT_STRENGTH://"item-invis" - if(Item_ItemsTime_UpdateTime_Check(it_invisible_time, t)) - it_invisible_time = t; + it_invisible_time = t; break; case IT_NAILS://"item-extralife" - if(Item_ItemsTime_UpdateTime_Check(it_extralife_time, t)) - it_extralife_time = t; + it_extralife_time = t; break; case IT_INVINCIBLE://"item-speed" - if(Item_ItemsTime_UpdateTime_Check(it_speed_time, t)) - it_speed_time = t; + it_speed_time = t; break; } } @@ -514,37 +502,30 @@ void Item_ItemsTime_UpdateTime(entity e, float t) { case IT_HEALTH: // if(e.classname == "item_health_mega") // IT_HEALTH unequivocally identifies it - if(Item_ItemsTime_UpdateTime_Check(it_health_mega_time, t)) - it_health_mega_time = t; + it_health_mega_time = t; break; case IT_ARMOR: if(e.classname == "item_armor_large") // IT_ARMOR doesn't unequivocally identifies it - if(Item_ItemsTime_UpdateTime_Check(it_armor_large_time, t)) - it_armor_large_time = t; + it_armor_large_time = t; break; case IT_STRENGTH://"item-strength" - if(Item_ItemsTime_UpdateTime_Check(it_strength_time, t)) - it_strength_time = t; + it_strength_time = t; break; case IT_INVINCIBLE://"item-shield" - if(Item_ItemsTime_UpdateTime_Check(it_shield_time, t)) - it_shield_time = t; + it_shield_time = t; break; default: if(e.weapons & WEPSET_SUPERWEAPONS) - if(Item_ItemsTime_UpdateTime_Check(it_superweapons_time, t)) - it_superweapons_time = t; + it_superweapons_time = t; } } switch(e.items) { case IT_FUEL_REGEN://"item-fuelregen" - if(Item_ItemsTime_UpdateTime_Check(it_fuelregen_time, t)) - it_fuelregen_time = t; + it_fuelregen_time = t; break; case IT_JETPACK://"item-jetpack" - if(Item_ItemsTime_UpdateTime_Check(it_jetpack_time, t)) - it_jetpack_time = t; + it_jetpack_time = t; break; } }