From eb732572ba7665a795fff5e894c227d9bb197b1e Mon Sep 17 00:00:00 2001 From: reaperrr Date: Mon, 15 Sep 2014 12:41:16 +0200 Subject: [PATCH] If we cache world anyway, might as well use it everywhere. --- OpenRA.Mods.RA/Effects/Bullet.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.RA/Effects/Bullet.cs b/OpenRA.Mods.RA/Effects/Bullet.cs index 1de36d10df..6c6acba028 100755 --- a/OpenRA.Mods.RA/Effects/Bullet.cs +++ b/OpenRA.Mods.RA/Effects/Bullet.cs @@ -70,8 +70,8 @@ namespace OpenRA.Mods.RA.Effects if (info.Angle.Length > 1 && info.Speed.Length > 1) { - angle = new WAngle(args.SourceActor.World.SharedRandom.Next(info.Angle[0].Angle, info.Angle[1].Angle)); - speed = new WRange(args.SourceActor.World.SharedRandom.Next(info.Speed[0].Range, info.Speed[1].Range)); + angle = new WAngle(world.SharedRandom.Next(info.Angle[0].Angle, info.Angle[1].Angle)); + speed = new WRange(world.SharedRandom.Next(info.Speed[0].Range, info.Speed[1].Range)); } else { @@ -86,7 +86,7 @@ namespace OpenRA.Mods.RA.Effects .Select(m => m.GetInaccuracyModifier()); var inaccuracy = Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, modifiers); var maxOffset = inaccuracy * (target - pos).Length / args.Weapon.Range.Range; - target += WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * maxOffset / 1024; + target += WVec.FromPDF(world.SharedRandom, 2) * maxOffset / 1024; } facing = Traits.Util.GetFacing(target - pos, 0); @@ -101,7 +101,7 @@ namespace OpenRA.Mods.RA.Effects if (info.ContrailLength > 0) { var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor; - trail = new ContrailRenderable(args.SourceActor.World, color, info.ContrailLength, info.ContrailDelay, 0); + trail = new ContrailRenderable(world, color, info.ContrailLength, info.ContrailDelay, 0); } smokeTicks = info.TrailDelay;