]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a cvar to control the minimum speed a vehicle needs to be travelling to crush...
authorMario <mario@smbclan.net>
Thu, 29 Aug 2019 17:03:18 +0000 (03:03 +1000)
committerMario <mario@smbclan.net>
Thu, 29 Aug 2019 17:03:18 +0000 (03:03 +1000)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh
vehicles.cfg

index f0877269c12b8ef9653e926004f7b2fb1a1c1c81..6785a9f21536b0dc1f312cdb65bdae9bdc405f97 100644 (file)
@@ -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".
index 9870814d30e4e3287c39adf4f8fd3938b9b2bd6f..0d707b52fc15af238e7f156772b12a0d58f929fb 100644 (file)
@@ -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;
index 489d82b15430a9a7945f36527f9510d7af8e6b47..d3a2c0bc5658e578f14f4236f97530ddfd5f18cb 100644 (file)
@@ -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