]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add effects for spawned vehicles from the nade or anything
authorLegendaryGuard <rootuser999@gmail.com>
Fri, 24 Jun 2022 22:39:34 +0000 (00:39 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Fri, 24 Jun 2022 22:39:34 +0000 (00:39 +0200)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh

index 3e4bf459a124514040ce55eff4be063d34091a3e..6986d7033e80424f318e259a259baa793b15298e 100644 (file)
@@ -421,7 +421,10 @@ void vehicles_reset_colors(entity this, entity player)
        this.alpha       = 1;
        this.avelocity = '0 0 0';
        this.velocity  = '0 0 0';
-       this.effects   = eff;
+       if (this.optionalsetup)
+               this.effects = EF_DIMLIGHT;
+       else 
+               this.effects   = eff;
 
        Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid);
        info.vr_setcolors(info, this);
@@ -1295,6 +1298,7 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
 entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid)
 {
        e.spawnflags = VHF_MULTISLOT;
+       e.optionalsetup = true;
        
        // TODO: Make a respawn option, the following line isn't functional
        if(!respwn) { e.spawnflags |= VHF_ISVEHICLE; }
@@ -1351,7 +1355,7 @@ entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, en
        // e.angles = '0 0 0';
        e.velocity = randomvec() * 150 + '0 0 325';
        e.spawnfunc_checked = true;
-       time = 0.6;
+       time = 0.7;
        
        vehicle_initialize(e, veh, true);
 
index f9f44334702ddd9e8e48c14fdd5c6f3ba8b3b157..cfaefba96286cff61e435204854d9de7b168082a 100644 (file)
@@ -82,6 +82,7 @@ const int MAX_AXH = 4;
 .float  lock_strength;
 .float  lock_time;
 .float  lock_soundtime;
+.bool optionalsetup;
 
 // vehicle functions
 .void(int _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns