From 750f4d1b8394736fbaeb8d36a087b28443dc0c0d Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 May 2019 01:47:36 +1000 Subject: [PATCH] Actually fix entering vehicles in independent players mode --- qcsrc/server/client.qc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index f873809b0..8261f36b3 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2331,19 +2331,15 @@ void PlayerUseKey(entity this) } else if(autocvar_g_vehicles_enter) { - if(!STAT(FROZEN, this)) - if(!IS_DEAD(this)) - if(!game_stopped) + if(!game_stopped && !STAT(FROZEN, this) && !IS_DEAD(this) && !IS_INDEPENDENT_PLAYER(this)) { entity head, closest_target = NULL; head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true); while(head) // find the closest acceptable target to enter { - if(IS_VEHICLE(head)) - if(!IS_DEAD(head)) + if(IS_VEHICLE(head) && !IS_DEAD(head) && head.takedamage != DAMAGE_NO) if(!head.owner || ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, this))) - if(head.takedamage != DAMAGE_NO) { if(closest_target) { @@ -2475,20 +2471,19 @@ void PlayerPreThink (entity this) if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle) 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), + FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it) && !IS_DEAD(it) && it.takedamage != DAMAGE_NO, { - if(!IS_DEAD(it) && it.takedamage != DAMAGE_NO) - if((it.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(it.owner, this)) - { - Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER); - } - else if(!it.owner) + if(!it.owner) { if(!it.team || SAME_TEAM(this, it)) Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER); else if(autocvar_g_vehicles_steal) Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_STEAL); } + else if((it.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(it.owner, this)) + { + Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER); + } }); this.last_vehiclecheck = time + 1; -- 2.39.2