]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Nerf stolen vehicles by disabling their shields
authorMario <mario@smbclan.net>
Tue, 20 Jun 2017 03:31:59 +0000 (13:31 +1000)
committerMario <mario@smbclan.net>
Tue, 20 Jun 2017 03:31:59 +0000 (13:31 +1000)
qcsrc/common/notifications/all.inc
qcsrc/common/vehicles/sv_vehicles.qc

index 9f3eb37c24a5dbb4f0177dbbef9c588f7c07ff3e..8b5edbf6f471f966874e83282abc5a00d788e610 100644 (file)
     MSG_CENTER_NOTIF(VEHICLE_ENTER_GUNNER,              N_ENABLE,    0, 0, "pass_key",       CPID_VEHICLES,          "0 0",  _("^BGPress ^F2%s^BG to enter the vehicle gunner"), "")
     MSG_CENTER_NOTIF(VEHICLE_ENTER_STEAL,               N_ENABLE,    0, 0, "pass_key",       CPID_VEHICLES,          "0 0",  _("^BGPress ^F2%s^BG to steal this vehicle"), "")
     MSG_CENTER_NOTIF(VEHICLE_STEAL,                     N_ENABLE,    0, 0, "",               CPID_VEHICLES_OTHER,    "0 0",  _("^F2The enemy is stealing one of your vehicles!\n^F4Stop them!"), "")
-    MSG_CENTER_NOTIF(VEHICLE_STEAL_SELF,                N_ENABLE,    0, 0, "",               CPID_VEHICLES_OTHER,    "4 0",  _("^F2You have stolen the enemy's vehicle, you are now visible on their radar!"), "")
+    MSG_CENTER_NOTIF(VEHICLE_STEAL_SELF,                N_ENABLE,    0, 0, "",               CPID_VEHICLES_OTHER,    "4 0",  _("^F2Intruder detected, disabling shields!"), "")
 
     MSG_CENTER_NOTIF(WEAPON_MINELAYER_LIMIT,            N_ENABLE,    0, 1, "f1",             CPID_Null,              "0 0",  _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "")
 
index 1057d1806d0b63fc7f56ad929be9cd84b2197364..47991b42391a902793e4cf62a4f815d8c38653a1 100644 (file)
@@ -785,6 +785,7 @@ vector vehicles_findgoodexit(entity this, entity player, vector prefer_spot)
        return this.origin;
 }
 
+.int old_vehicle_flags;
 void vehicles_exit(entity vehic, bool eject)
 {
        entity player = vehic.owner;
@@ -863,6 +864,10 @@ void vehicles_exit(entity vehic, bool eject)
 
        vehic.team = vehic.tur_head.team;
 
+       if(vehic.old_vehicle_flags & VHF_SHIELDREGEN)
+               vehic.vehicle_flags |= VHF_SHIELDREGEN;
+       vehic.old_vehicle_flags = 0;
+
        sound (vehic, CH_TRIGGER_SINGLE, SND_Null, 1, ATTEN_NORM);
        vehic.vehicle_hudmodel.viewmodelforclient = vehic;
        vehic.phase = time + 1;
@@ -969,6 +974,10 @@ void vehicles_enter(entity pl, entity veh)
 
                Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_STEAL_SELF);
 
+               veh.vehicle_shield = 0;
+               veh.old_vehicle_flags = veh.vehicle_flags; // make a backup just so we're not permanently crippling this vehicle
+               veh.vehicle_flags &= ~VHF_SHIELDREGEN;
+
                if (autocvar_g_vehicles_steal_show_waypoint) {
                        entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', NULL, veh.team, veh, wps_intruder, true, RADARICON_DANGER);
                        wp.colormod = Team_ColorRGB(pl.team);