Add Angle datafield to `ProjectileComponent`. It allows to change the angle of the fired projectile
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ProjectileComponent : Component
{
+ /// <summary>
+ /// The angle of the fired projectile.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public Angle Angle;
+
/// <summary>
/// The effect that appears when a projectile collides with an entity.
/// </summary>
Projectiles.SetShooter(uid, projectile, user ?? gunUid);
projectile.Weapon = gunUid;
- TransformSystem.SetWorldRotation(uid, direction.ToWorldAngle());
+ TransformSystem.SetWorldRotation(uid, direction.ToWorldAngle() + projectile.Angle);
}
protected abstract void Popup(string message, EntityUid? uid, EntityUid? user);