From: Mario Date: Tue, 20 Jun 2017 03:31:59 +0000 (+1000) Subject: Nerf stolen vehicles by disabling their shields X-Git-Tag: xonotic-v0.8.5~2716 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ae40740ed2a92b8344485f5890e0a8264674156;p=xonotic%2Fxonotic-data.pk3dir.git Nerf stolen vehicles by disabling their shields --- diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 9f3eb37c2..8b5edbf6f 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -785,7 +785,7 @@ 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"), "") diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 1057d1806..47991b423 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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);