]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/vehicles/bumblebee.qc
Merge branch 'terencehill/ca_arena_freezetag_bugfixes' into terencehill/arena_gamemode
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / bumblebee.qc
index fc661625e6620909dc3f12896d8c379786597ade..b9c7dbfb8339e406603dbbea763f63c28ea81c24 100644 (file)
@@ -236,18 +236,17 @@ void bumb_gunner_exit(float _exitflag)
        self.movetype       = MOVETYPE_WALK;
        self.effects        &~= EF_NODRAW;
        self.alpha          = 1;
-       self.PlayerPhysplug = SUB_Null;
+       self.PlayerPhysplug = func_null;
        self.view_ofs       = PL_VIEW_OFS;
        self.event_damage   = PlayerDamage;
        self.hud            = HUD_NORMAL;
        self.switchweapon   = self.vehicle.switchweapon;
 
-       if(self.flagcarried)
-       {
-               self.flagcarried.scale = 0.6;
-               setattachment(self.flagcarried, self, "");
-               setorigin(self.flagcarried, FLAG_CARRY_POS);
-       }
+    vh_player = self;
+    vh_vehicle = self.vehicle;
+    MUTATOR_CALLHOOK(VehicleExit);
+    self = vh_player;
+    self.vehicle = vh_vehicle;
 
        self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle;
 
@@ -308,7 +307,7 @@ float bumb_gunner_enter()
        other.solid             = SOLID_NOT;
        other.movetype          = MOVETYPE_NOCLIP;
        other.alpha             = -1;
-       other.event_damage      = SUB_Null;
+       other.event_damage      = func_null;
        other.view_ofs          = '0 0 0';
        other.hud               = _gun.hud;
        other.PlayerPhysplug    = _gun.PlayerPhysplug;
@@ -331,17 +330,11 @@ float bumb_gunner_enter()
 
        CSQCVehicleSetup(other, other.hud);
        
-    if(other.flagcarried)
-    {
-        if(!autocvar_g_vehicles_allow_flagcarry)
-            DropFlag(other.flagcarried, world, world);
-        else
-        {
-            other.flagcarried.scale = 1;
-            setattachment(other.flagcarried, self, "");
-            setorigin(other.flagcarried, '0 0 1' * self.maxs_z);
-        }
-    }
+    vh_player = other;
+    vh_vehicle = _gun;
+    MUTATOR_CALLHOOK(VehicleEnter);
+    other = vh_player;
+    _gun = vh_vehicle;
 
        return TRUE;
 }
@@ -772,7 +765,8 @@ void bumb_die()
        entity oldself = self;
        
        // Hide beam
-       self.gun3.enemy.effects |= EF_NODRAW;
+       if(self.gun3.enemy || !wasfreed(self.gun3.enemy))
+               self.gun3.enemy.effects |= EF_NODRAW;
        
        if(self.gunner1)
        {
@@ -800,7 +794,7 @@ void bumb_die()
        if(random() > 0.5)
                _body.touch = bumb_blowup;
        else
-               _body.touch = SUB_Null;
+               _body.touch = func_null;
                
        _body.think = bumb_diethink;
        _body.nextthink = time;
@@ -811,7 +805,7 @@ void bumb_die()
        pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
        
        self.health                     = 0;
-       self.event_damage       = SUB_Null;
+       self.event_damage       = func_null;
        self.solid                      = SOLID_CORPSE;
        self.takedamage         = DAMAGE_NO;
        self.deadflag           = DEAD_DYING;
@@ -820,7 +814,7 @@ void bumb_die()
        self.colormod           = '0 0 0';
        self.avelocity          = '0 0 0';
        self.velocity           = '0 0 0';
-       self.touch                      = SUB_Null;
+       self.touch                      = func_null;
        self.nextthink          = 0;
 
        setorigin(self, self.pos1);