]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Now vehicles can't be respawned after being spawned and destroyed, plus add nodrop...
authorLegendaryGuard <rootuser999@gmail.com>
Fri, 1 Jul 2022 23:54:05 +0000 (01:54 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Fri, 1 Jul 2022 23:54:05 +0000 (01:54 +0200)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh

index 98bb3dc87956906ca0aa4f2b33909d32018e98b7..61449fcb712d6de3746fc800bd11c9ffb96d3a14 100644 (file)
@@ -1012,7 +1012,8 @@ void nade_emerald_boom(entity this)
                                this.origin, 
                                true, 
                                false, 
-                               true
+                               true,
+                               false
                        );
 
                        if(!e)
index 3fb9f38b09bc85824e84044c550e9098e6e0dadc..c41889a0567e265ac94218aedff486546528b9f6 100644 (file)
@@ -521,6 +521,9 @@ void vehicles_setreturn(entity veh)
        {
                if (veh.cannot_respawn) 
                {
+                       sound (veh, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+                       Send_Effect(EFFECT_EXPLOSION_BIG, veh.origin + '0 0 100', '0 0 0', 1);
+
                        delete(veh);
                        return;
                }
@@ -529,7 +532,8 @@ void vehicles_setreturn(entity veh)
        }
        else
        {
-               ret.nextthink   = min(time + veh.respawntime, time + veh.respawntime - 1);
+               if (!veh.cannot_respawn) // if true, don't respawn
+                       ret.nextthink   = min(time + veh.respawntime, time + veh.respawntime - 1);
        }
 
        setorigin(ret, veh.pos1 + '0 0 96');
@@ -1303,7 +1307,7 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
        return true;
 }
 
-entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional)
+entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional, bool nodrop)
 {
        e.spawnflags = VHF_MULTISLOT;
 
@@ -1348,7 +1352,7 @@ entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, en
                                return NULL; // no good
                        }
                        // select a random valid vehicle type if no valid vehicle was provided
-                       return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, no_respwn, removeifinvalid, optional);
+                       return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, no_respwn, removeifinvalid, optional, nodrop);
                }
        }
 
@@ -1368,7 +1372,7 @@ entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, en
        e.spawnfunc_checked = true;
 
        // spawn!
-       vehicle_initialize(e, veh, true);
+       vehicle_initialize(e, veh, nodrop);
 
        return e;
 }
index 141c025e218771dc8acf6f087672bc429685970a..a28fe077eb600d4590ba7a5bd09ded25232b2df4 100644 (file)
@@ -106,7 +106,7 @@ float vehicles_exit_running;
 
 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
 
-entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional);
+entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional, bool nodrop);
 void vehicles_exit(entity vehic, int eject);
 bool vehicle_initialize(entity this, Vehicle info, float nodrop);
 bool vehicle_impulse(entity this, int imp);