]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't use nade team (breaks modes where friendly fire is enforced on projectiles)
authorMario <mario@smbclan.net>
Sun, 13 Mar 2016 22:22:01 +0000 (08:22 +1000)
committerMario <mario@smbclan.net>
Sun, 13 Mar 2016 22:22:01 +0000 (08:22 +1000)
qcsrc/common/mutators/mutator/nades/nades.qc

index 250a3ef71a1797f10ffeb45467c65b695ef77f6c..16a435dd17339875072602fff898b02a58128f68 100644 (file)
@@ -256,7 +256,7 @@ void nade_napalm_ball()
        proj = new(grenade);
        proj.owner = self.owner;
        proj.realowner = self.realowner;
-       proj.team = self.team;
+       proj.team = self.owner.team;
        proj.bot_dodge = true;
        proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
        proj.movetype = MOVETYPE_BOUNCE;
@@ -374,7 +374,7 @@ void nade_ice_think()
        {
                if ( autocvar_g_nades_ice_explode )
                {
-                       entity expef = EFFECT_NADE_EXPLODE(self.team);
+                       entity expef = EFFECT_NADE_EXPLODE(self.realowner.team);
                        Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
                        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 
@@ -569,7 +569,7 @@ void nade_heal_boom()
        setorigin(healer, self.origin);
        healer.healer_lifetime = autocvar_g_nades_heal_time; // save the cvar
        healer.ltime = time + healer.healer_lifetime;
-       healer.team = self.team;
+       healer.team = self.realowner.team;
        healer.bot_dodge = false;
        healer.solid = SOLID_TRIGGER;
        healer.touch = nade_heal_touch;
@@ -616,7 +616,7 @@ void nade_boom()
                case NADE_TYPE_MONSTER:
                case NADE_TYPE_SPAWN:
                        nade_blast = false;
-                       switch(self.team)
+                       switch(self.realowner.team)
                        {
                                case NUM_TEAM_1: expef = EFFECT_SPAWN_RED; break;
                                case NUM_TEAM_2: expef = EFFECT_SPAWN_BLUE; break;
@@ -632,7 +632,7 @@ void nade_boom()
 
                default:
                case NADE_TYPE_NORMAL:
-                       expef = EFFECT_NADE_EXPLODE(self.team);
+                       expef = EFFECT_NADE_EXPLODE(self.realowner.team);
                        break;
        }
 
@@ -799,10 +799,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
        this.health -= damage;
 
        if ( this.nade_type != NADE_TYPE_HEAL.m_id || IS_PLAYER(attacker) )
-       {
-               this.team = attacker.team;
                this.realowner = attacker;
-       }
 
        if(this.health <= 0)
                WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, nade_boom));
@@ -962,8 +959,7 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
        //setattachment(n, player, "bip01 l hand");
        n.exteriormodeltoclient = player;
        n.customizeentityforclient = nade_customize;
-       n.team = player.team;
-       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], n.team).eent_eff_name);
+       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], player.team).eent_eff_name);
        n.colormod = Nades_from(n.nade_type).m_color;
        n.realowner = nowner;
        n.colormap = player.colormap;