Convert AnimationWithOffset to world coords.
Animations (via Actor.CenterPosition) now understand Altitude, so there is potential for mis-positioned animations if any existing altitude hacks were missed.
This commit is contained in:
@@ -28,11 +28,13 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
/* rude hack */
|
||||
var visualOffset = ((move is Helicopter || move is Mobile) && move.Altitude > 0)
|
||||
? Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
|
||||
? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
|
||||
|
||||
var shadowSprites = r.Select(a => a.WithPalette(wr.Palette("shadow")));
|
||||
var flyingSprites = (move.Altitude <= 0) ? r
|
||||
: r.Select(a => a.WithPxOffset(new float2(0, -(move.Altitude + visualOffset))).WithZOffset(move.Altitude + a.ZOffset));
|
||||
var shadowSprites = r.Select(a => a.WithPalette(wr.Palette("shadow"))
|
||||
.WithPos(a.Pos - new WVec(0, 0, a.Pos.Z)).WithZOffset(-24));
|
||||
|
||||
var flyingSprites = (move.Altitude <= 0) ? r :
|
||||
r.Select(a => a.WithPos(a.Pos - new WVec(0,0,43*visualOffset)));
|
||||
|
||||
return shadowSprites.Concat(flyingSprites);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user