From 6be55b61aa5bc782cb25c10b51f6d13a34c24bf1 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 25 Jun 2011 11:51:04 +1200 Subject: [PATCH] fixed #934 -- convert all AttackBase.MuzzleFlash uses to WithMuzzleFlash --- OpenRA.Mods.RA/AttackBase.cs | 1 - OpenRA.Mods.RA/Render/RenderUnitTurreted.cs | 12 ------------ mods/cnc/rules/vehicles.yaml | 7 +++---- mods/ra/rules/vehicles.yaml | 3 +-- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/OpenRA.Mods.RA/AttackBase.cs b/OpenRA.Mods.RA/AttackBase.cs index 00575dd7e9..a5dbc91cda 100644 --- a/OpenRA.Mods.RA/AttackBase.cs +++ b/OpenRA.Mods.RA/AttackBase.cs @@ -29,7 +29,6 @@ namespace OpenRA.Mods.RA public readonly int[] SecondaryLocalOffset = { }; public readonly int[] PrimaryOffset = { 0, 0 }; public readonly int[] SecondaryOffset = null; - public readonly bool MuzzleFlash = false; public readonly int FireDelay = 0; public readonly bool AlignIdleTurrets = false; diff --git a/OpenRA.Mods.RA/Render/RenderUnitTurreted.cs b/OpenRA.Mods.RA/Render/RenderUnitTurreted.cs index c1e86cd5ef..e513eb0cdb 100755 --- a/OpenRA.Mods.RA/Render/RenderUnitTurreted.cs +++ b/OpenRA.Mods.RA/Render/RenderUnitTurreted.cs @@ -26,7 +26,6 @@ namespace OpenRA.Mods.RA.Render var facing = self.Trait(); var turreted = self.Trait(); var attack = self.TraitOrDefault(); - var attackInfo = self.Info.Traits.Get(); var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing ); turretAnim.Play( "turret" ); @@ -38,17 +37,6 @@ namespace OpenRA.Mods.RA.Render new AnimationWithOffset( turretAnim, () => Combat.GetTurretPosition( self, facing, turret ), null)); - - if (attackInfo.MuzzleFlash) - { - var muzzleFlash = new Animation(GetImage(self), () => turreted.turretFacing); - muzzleFlash.PlayFetchIndex("muzzle", - () => (int)(turret.Recoil * 5.9f)); /* hack: dumb crap */ - anims.Add("muzzle_flash_{0}".F(i), - new AnimationWithOffset(muzzleFlash, - () => Combat.GetTurretPosition(self, facing, turret), - () => turret.Recoil <= 0)); - } } } } diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index ca92f3ac62..6ef879233d 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -94,7 +94,6 @@ APC: AttackFrontal: PrimaryWeapon: QuadCannon PrimaryOffset: 0,0,0,-4 - MuzzleFlash: yes RenderUnit: WithMuzzleFlash: AutoTarget: @@ -195,7 +194,7 @@ BGGY: AttackTurreted: PrimaryWeapon: MachineGun PrimaryOffset: 0,1,0,-3 - MuzzleFlash: yes + WithMuzzleFlash: RenderUnitTurreted: AutoTarget: LeavesHusk: @@ -257,7 +256,7 @@ JEEP: AttackTurreted: PrimaryWeapon: MachineGun PrimaryOffset: 0,0,0,-2 - MuzzleFlash: yes + WithMuzzleFlash: RenderUnitTurreted: AutoTarget: LeavesHusk: @@ -471,4 +470,4 @@ STNK: AutoTarget: TargetableUnit: LeavesHusk: - HuskActor: STNK.Husk \ No newline at end of file + HuskActor: STNK.Husk diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index 0567828a78..b83f1c674c 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -288,7 +288,7 @@ JEEP: AttackTurreted: PrimaryWeapon: M60mg PrimaryOffset: 0,0,0,-2 - MuzzleFlash: yes + WithMuzzleFlash: RenderUnitTurreted: AutoTarget: Cargo: @@ -319,7 +319,6 @@ APC: AttackFrontal: PrimaryWeapon: M60mg PrimaryOffset: 0,0,0,-4 - MuzzleFlash: yes RenderUnit: WithMuzzleFlash: AutoTarget: