Fixes all the rotation bugs. (#3365)
This commit is contained in:
committed by
GitHub
parent
6d48154617
commit
63947a6d35
@@ -34,16 +34,13 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = _angle.RotateVec((BaseOffset, 0));
|
||||
offset = _angle.RotateVec((0, -BaseOffset));
|
||||
offset *= (ResetTime - _time) / ResetTime;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out ISpriteComponent spriteComponent))
|
||||
{
|
||||
// We have to account for rotation so the offset still checks out.
|
||||
// SpriteComponent.Offset is applied before transform rotation (as expected).
|
||||
var worldRotation = Owner.Transform.WorldRotation;
|
||||
spriteComponent.Offset = new Angle(-worldRotation).RotateVec(offset);
|
||||
spriteComponent.Offset = offset;
|
||||
}
|
||||
|
||||
if (deleteSelf)
|
||||
|
||||
Reference in New Issue
Block a user