From 6e44347e3ec9f9df3882325707e966e9fd9b7f42 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 May 2019 23:40:27 +1000 Subject: [PATCH] Don't allow pressing F to enter a vehicle when in independent players mode, fixes some bugs in CTS --- .../mutator/touchexplode/sv_touchexplode.qc | 14 ++++---------- qcsrc/server/client.qc | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc b/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc index 6be2c5963..5d46a9edf 100644 --- a/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc +++ b/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc @@ -28,21 +28,15 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(time > player.touchexplode_time) - if(!game_stopped) - if(!STAT(FROZEN, player)) - if(IS_PLAYER(player)) - if(!IS_DEAD(player)) - if(!IS_INDEPENDENT_PLAYER(player)) + if(time > player.touchexplode_time && !game_stopped && !IS_DEAD(player) && IS_PLAYER(player) && !STAT(FROZEN, player) && !IS_INDEPENDENT_PLAYER(player)) + { FOREACH_CLIENT(IS_PLAYER(it) && it != player, { - if(time > it.touchexplode_time) - if(!STAT(FROZEN, it)) - if(!IS_DEAD(it)) - if (!IS_INDEPENDENT_PLAYER(it)) + if(time > it.touchexplode_time && !STAT(FROZEN, it) && !IS_DEAD(it) && !IS_INDEPENDENT_PLAYER(it)) if(boxesoverlap(player.absmin, player.absmax, it.absmin, it.absmax)) { PlayerTouchExplode(player, it); player.touchexplode_time = it.touchexplode_time = time + 0.2; } }); + } } diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 1bb51fdb7..f873809b0 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2473,7 +2473,7 @@ void PlayerPreThink (entity this) MUTATOR_CALLHOOK(PlayerPreThink, this); if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle) - if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this)) + if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this) && !IS_INDEPENDENT_PLAYER(this)) { FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it), { -- 2.39.2