From 477894058d19bcfd8b5b65c0c6eddb2a2509963b Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Sat, 25 Jun 2022 00:39:34 +0200 Subject: [PATCH] Add effects for spawned vehicles from the nade or anything --- qcsrc/common/vehicles/sv_vehicles.qc | 8 ++++++-- qcsrc/common/vehicles/sv_vehicles.qh | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 3e4bf459a1..6986d7033e 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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); diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index f9f4433470..cfaefba962 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -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 -- 2.39.2