Change IRenderable.WithPos -> OffsetBy.

This is more appropriate for the actual use cases.
Fixes #3621.
This commit is contained in:
Paul Chote
2013-08-03 11:16:52 +12:00
parent 3788d4f185
commit 805b4b6258
11 changed files with 18 additions and 15 deletions

View File

@@ -31,10 +31,11 @@ namespace OpenRA.Mods.RA.Render
? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
var shadowSprites = r.Select(a => a.WithPalette(wr.Palette("shadow"))
.WithPos(a.Pos - new WVec(0, 0, a.Pos.Z)).WithZOffset(a.ZOffset + a.Pos.Z));
.OffsetBy(new WVec(0, 0, -a.Pos.Z)).WithZOffset(a.ZOffset + a.Pos.Z));
var worldVisualOffset = new WVec(0,0,-43*visualOffset);
var flyingSprites = !flying ? r :
r.Select(a => a.WithPos(a.Pos - new WVec(0,0,43*visualOffset)));
r.Select(a => a.OffsetBy(worldVisualOffset));
return shadowSprites.Concat(flyingSprites);
}