From: Mario Date: Thu, 29 Aug 2019 17:03:18 +0000 (+1000) Subject: Add a cvar to control the minimum speed a vehicle needs to be travelling to crush... X-Git-Tag: xonotic-v0.8.5~1350 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=071abfacf6581eb6d8112236ee42ce041d348e21;hp=3ac61b98c83be079c61cf525491d2028b2a889dc;ds=sidebyside Add a cvar to control the minimum speed a vehicle needs to be travelling to crush a player and increase the speed from 30 to 100 --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index f0877269c1..6785a9f215 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -919,12 +919,12 @@ void vehicles_touch(entity this, entity toucher) // Vehicle currently in use if(this.owner) { - if(!weaponLocked(this.owner)) if(toucher != NULL) if((this.origin_z + this.maxs_z) > (toucher.origin_z)) if(vehicles_crushable(toucher)) + if(!weaponLocked(this.owner)) { - if(vdist(this.velocity, >=, 30)) + if(vdist(this.velocity, >=, autocvar_g_vehicles_crush_minspeed)) Damage(toucher, this, this.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH.m_id, DMG_NOWEP, '0 0 0', normalize(toucher.origin - this.origin) * autocvar_g_vehicles_crush_force); return; // Dont do selfdamage when hitting "soft targets". diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index 9870814d30..0d707b52fc 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -12,6 +12,7 @@ AUTOCVAR(g_vehicles_steal, bool, true, "allow stealing enemy vehicles in teampla AUTOCVAR(g_vehicles_steal_show_waypoint, bool, true, "show a waypoint above the thief"); float autocvar_g_vehicles_crush_dmg = 70; float autocvar_g_vehicles_crush_force = 50; +float autocvar_g_vehicles_crush_minspeed = 100; bool autocvar_g_vehicles_delayspawn = true; float autocvar_g_vehicles_delayspawn_jitter = 10; float autocvar_g_vehicles_allow_bots; diff --git a/vehicles.cfg b/vehicles.cfg index 489d82b154..d3a2c0bc56 100644 --- a/vehicles.cfg +++ b/vehicles.cfg @@ -11,6 +11,7 @@ set g_vehicles_teams 1 "allow team specific vehicles" set g_vehicles_teleportable 0 set g_vehicles_crush_dmg 70 set g_vehicles_crush_force 50 +set g_vehicles_crush_minspeed 100 set g_vehicles_allow_bots 0 set g_vehicles_exit_attempts 25 set g_vehicles_thinkrate 0.1