]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix death logic of spawned vehicles
authorLegendaryGuard <rootuser999@gmail.com>
Tue, 23 Aug 2022 19:26:18 +0000 (21:26 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Tue, 23 Aug 2022 19:26:18 +0000 (21:26 +0200)
qcsrc/common/vehicles/sv_vehicles.qc

index c96595533a3a5594c07de6b6b962e41df083ff7b..652a9d5d844b3f729a3b4d03463d1307bde0dece 100644 (file)
@@ -376,10 +376,8 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string
 
 void vehicles_remove(entity this)
 {
-       Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid);
-       info.vr_death(info, this);
-
        // to avoid weird entity assignments to other stuff like projectiles
+    this.deadflag = DEAD_DEAD;
        this.active = ACTIVE_NOT;
        vehicles_reset(this);
        this.classname = "";
@@ -451,7 +449,7 @@ void vehicles_reset_colors(entity this, entity player)
        this.avelocity = '0 0 0';
        this.velocity  = '0 0 0';
        if (this.optional_setup)
-               this.effects = EF_DIMLIGHT;
+               this.effects |= EF_DIMLIGHT;
        else 
                this.effects = eff;
 
@@ -550,6 +548,9 @@ void vehicles_setreturn(entity veh)
        {
                if (veh.cannot_respawn)
                {
+                       Vehicle info = veh.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid);
+                       info.vr_death(info, veh);
+                       
                        RadiusDamage (veh, veh.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_CRUSH.m_id, DMG_NOWEP, NULL);
                        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);