From: terencehill Date: Sat, 10 Jul 2010 13:07:10 +0000 (+0200) Subject: Limit health/armor in minstagib: X-Git-Tag: xonotic-v0.1.0preview~454^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=a300d8523d6b10e36899d331461443c3028fce6c Limit health/armor in minstagib: - limit health and armor that can be given by the command give. - do not allow to get more then 999 extralives (it could happen after u cheated with give command). OT: add a clarifier comment. --- diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 63e6a2b528..35e30f1849 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -303,7 +303,7 @@ float Item_GiveTo(entity item, entity player) pickedup = TRUE; // sound not available // AnnounceTo(player, "_lives"); - player.armorvalue = player.armorvalue + cvar("g_minstagib_extralives"); + player.armorvalue = min(player.armorvalue + cvar("g_minstagib_extralives"), 999); sprint(player, "^3You picked up some extra lives\n"); } @@ -1134,7 +1134,7 @@ void spawnfunc_weapon_rocketlauncher (void) { if (g_minstagib) { - minstagib_items(IT_CELLS); + minstagib_items(IT_CELLS); // replace rocketlauncher with cells self.think = minst_remove_item; self.nextthink = time; return; @@ -1767,6 +1767,12 @@ float GiveItems(entity e, float beginarg, float endarg) POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null); POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null); + if (g_minstagib) + { + e.health = bound(0, e.health, 100); + e.armorvalue = bound(0, e.armorvalue, 999); + } + if(e.strength_finished <= 0) e.strength_finished = 0; else