Replace WPos.ToCPos -> Map.CellContaining.
This commit is contained in:
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
trail.Update(pos);
|
||||
|
||||
if (ticks++ >= length || (!info.High && world.ActorMap
|
||||
.GetUnitsAt(pos.ToCPos()).Any(a => a.HasTrait<IBlocksBullets>())))
|
||||
.GetUnitsAt(world.Map.CellContaining(pos)).Any(a => a.HasTrait<IBlocksBullets>())))
|
||||
{
|
||||
Explode(world);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
if (anim == null || ticks >= length)
|
||||
yield break;
|
||||
|
||||
var cell = pos.ToCPos();
|
||||
var cell = wr.world.Map.CellContaining(pos);
|
||||
if (!args.SourceActor.World.FogObscures(cell))
|
||||
{
|
||||
if (info.Shadow)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (wr.world.FogObscures(pos.ToCPos()))
|
||||
if (wr.world.FogObscures(wr.world.Map.CellContaining(pos)))
|
||||
yield break;
|
||||
|
||||
yield return new TextRenderable(font, pos, 0, color, text);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
{
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.cell = pos.ToCPos();
|
||||
this.cell = world.Map.CellContaining(pos);
|
||||
this.paletteName = paletteName;
|
||||
anim = new Animation(world, image);
|
||||
anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
{
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.cell = pos.ToCPos();
|
||||
this.cell = world.Map.CellContaining(pos);
|
||||
this.palette = palette;
|
||||
anim = new Animation(world, "explosion");
|
||||
anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
var cell = pos.ToCPos();
|
||||
var cell = wr.world.Map.CellContaining(pos);
|
||||
if (!args.SourceActor.World.FogObscures(cell))
|
||||
{
|
||||
if (info.Shadow)
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
if (info.ContrailLength > 0)
|
||||
trail.Update(pos);
|
||||
|
||||
var cell = pos.ToCPos();
|
||||
var cell = world.Map.CellContaining(pos);
|
||||
|
||||
var shouldExplode = (pos.Z < 0) // Hit the ground
|
||||
|| (dist.LengthSquared < MissileCloseEnough.Range * MissileCloseEnough.Range) // Within range
|
||||
@@ -186,7 +186,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
if (info.ContrailLength > 0)
|
||||
yield return trail;
|
||||
|
||||
if (!args.SourceActor.World.FogObscures(pos.ToCPos()))
|
||||
if (!args.SourceActor.World.FogObscures(wr.world.Map.CellContaining(pos)))
|
||||
{
|
||||
var palette = wr.Palette(args.Weapon.Palette);
|
||||
foreach (var r in anim.Render(pos, palette))
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
parachuteOffset = pai.Offset;
|
||||
|
||||
// Adjust x,y to match the target subcell
|
||||
cargo.Trait<IPositionable>().SetPosition(cargo, dropPosition.ToCPos());
|
||||
cargo.Trait<IPositionable>().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition));
|
||||
var cp = cargo.CenterPosition;
|
||||
pos = new WPos(cp.X, cp.Y, dropPosition.Z);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
{
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.cell = pos.ToCPos();
|
||||
this.cell = world.Map.CellContaining(pos);
|
||||
|
||||
anim = new Animation(world, trail);
|
||||
anim.PlayThen("idle",
|
||||
|
||||
Reference in New Issue
Block a user