]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/vehicles/bumblebee.qc
Merge remote-tracking branch 'origin/master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / bumblebee.qc
index c0e354715d872b573859bccea7e43f3798fb9c67..b551fd3c721a2ec7fd07f3d652872ae64bebcb5e 100644 (file)
@@ -86,7 +86,7 @@ void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
        vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav",
                                                v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
                                                autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force,  0,
-                                               DEATH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
+                                               DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
 }
 
 float bumb_gunner_frame()
@@ -214,9 +214,7 @@ float bumb_gunner_frame()
 
 void bumb_gunner_exit(float _exitflag)
 {
-
-
-       if(clienttype(self) == CLIENTTYPE_REAL)
+       if(IS_REAL_CLIENT(self))
        {
                msg_entity = self;
                WriteByte(MSG_ONE, SVC_SETVIEWPORT);
@@ -236,18 +234,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 +305,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,24 +328,18 @@ 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;
 }
 
 float vehicles_valid_pilot()
 {
-       if(other.classname != "player")
+       if not(IS_PLAYER(other))
                return FALSE;
 
        if(other.deadflag != DEAD_NO)
@@ -357,7 +348,7 @@ float vehicles_valid_pilot()
        if(other.vehicle != world)
                return FALSE;
 
-       if(clienttype(other) != CLIENTTYPE_REAL)
+       if not(IS_REAL_CLIENT(other))
                if(!autocvar_g_vehicles_allow_bots)
                        return FALSE;
 
@@ -568,7 +559,7 @@ float bumb_pilot_frame()
                                                        if(autocvar_g_vehicle_bumblebee_healgun_hps)
                                                                trace_ent.vehicle_health = min(trace_ent.vehicle_health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.tur_health);
                                                }
-                                               else if(trace_ent.flags & FL_CLIENT)
+                                               else if(IS_CLIENT(trace_ent))
                                                {
                                                        if(trace_ent.health <= autocvar_g_vehicle_bumblebee_healgun_hmax && autocvar_g_vehicle_bumblebee_healgun_hps)
                                                                trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax);
@@ -742,7 +733,7 @@ void bumb_blowup()
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
                                 autocvar_g_vehicle_bumblebee_blowup_radius, self, world,
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
-                                DEATH_WAKIBLOWUP, world);
+                                DEATH_VH_BUMB_DEATH, world);
 
        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
        pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
@@ -801,7 +792,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;
@@ -812,7 +803,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;
@@ -821,7 +812,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);