From a20704f8b92aac2a71ef1b5c2971f9040497cd18 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 14 Mar 2016 08:22:01 +1000 Subject: [PATCH] Don't use nade team (breaks modes where friendly fire is enforced on projectiles) --- qcsrc/common/mutators/mutator/nades/nades.qc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 250a3ef71..16a435dd1 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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; -- 2.39.2