Fix various issues with the emitter (#3329)

Co-authored-by: cyclowns <cyclowns@protonmail.ch>
This commit is contained in:
mirrorcult
2021-03-14 15:02:22 -07:00
committed by GitHub
parent c73ef7c9af
commit e81db48cd1
15 changed files with 147 additions and 86 deletions

View File

@@ -1,4 +1,5 @@
#nullable enable
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Interactable;
@@ -74,6 +75,10 @@ namespace Content.Server.GameObjects.Components
var physics = Owner.GetComponent<IPhysBody>();
physics.BodyType = BodyType.Static;
// Snap rotation to cardinal (multiple of 90)
var rot = Owner.Transform.LocalRotation;
Owner.Transform.LocalRotation = Math.Round(rot / (Math.PI / 2)) * (Math.PI / 2);
if (Owner.TryGetComponent(out PullableComponent? pullableComponent))
{
if (pullableComponent.Puller != null)