From: Mario Date: Thu, 23 Jan 2020 20:19:56 +0000 (+1000) Subject: Bumblebee: limit the amount of armor provided by the bumblebee in instagib to the... X-Git-Tag: xonotic-v0.8.5~851^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9899491b3bdd938ceffddef78669983cffa058d8;p=xonotic%2Fxonotic-data.pk3dir.git Bumblebee: limit the amount of armor provided by the bumblebee in instagib to the value of g_instagib_extralives --- diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index 28e4bf926..93812044c 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -14,7 +14,6 @@ bool autocvar_g_instagib_ammo_convert_cells; bool autocvar_g_instagib_ammo_convert_rockets; bool autocvar_g_instagib_ammo_convert_shells; bool autocvar_g_instagib_ammo_convert_bullets; -int autocvar_g_instagib_extralives; float autocvar_g_instagib_speed_highspeed; IntrusiveList g_instagib_items; diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qh b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qh index 56f4ac7da..1f74f1fe5 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qh +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qh @@ -3,6 +3,7 @@ #include "items.qh" float autocvar_g_instagib_invis_alpha; +int autocvar_g_instagib_extralives; void instagib_invisibility(entity this); void instagib_extralife(entity this); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 7c0e61cd6..88713e77d 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -1,5 +1,9 @@ #include "bumblebee.qh" +#ifdef SVQC + #include +#endif + const float BRG_SETUP = 2; const float BRG_START = 4; const float BRG_END = 8; @@ -568,8 +572,9 @@ bool bumblebee_pilot_frame(entity this, float dt) } else if(IS_CLIENT(trace_ent)) { - if(GetResource(trace_ent, RES_ARMOR) <= autocvar_g_vehicle_bumblebee_healgun_amax && autocvar_g_vehicle_bumblebee_healgun_aps) - GiveResourceWithLimit(trace_ent, RES_ARMOR, autocvar_g_vehicle_bumblebee_healgun_aps * dt, autocvar_g_vehicle_bumblebee_healgun_amax); + float maxarmor = ((MUTATOR_IS_ENABLED(mutator_instagib)) ? autocvar_g_instagib_extralives : autocvar_g_vehicle_bumblebee_healgun_amax); + if(GetResource(trace_ent, RES_ARMOR) <= maxarmor && autocvar_g_vehicle_bumblebee_healgun_aps) + GiveResourceWithLimit(trace_ent, RES_ARMOR, autocvar_g_vehicle_bumblebee_healgun_aps * dt, maxarmor); } } }