Bumblebee: limit the amount of armor provided by the bumblebee in instagib to the...
authorMario <mario.mario@y7mail.com>
Thu, 23 Jan 2020 20:19:56 +0000 (06:19 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 23 Jan 2020 20:19:56 +0000 (06:19 +1000)
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qh
qcsrc/common/vehicles/vehicle/bumblebee.qc

index 28e4bf92684e752d5cb1ae223b05df92acd10a44..93812044c6b4b19ec79437ec8acd73dc9719451a 100644 (file)
@@ -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;
index 56f4ac7daaaace7d5d831d281107ed0632d75eaf..1f74f1fe53c9ed39eb687cd14bf5caf62b34005a 100644 (file)
@@ -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);
index 7c0e61cd6e662329db5d4eea736d8a2b347ebe56..88713e77d70921dd0727b30c79286a0210cf5a01 100644 (file)
@@ -1,5 +1,9 @@
 #include "bumblebee.qh"
 
+#ifdef SVQC
+       #include <common/mutators/mutator/instagib/sv_instagib.qh>
+#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);
                                                }
                                        }
                                }