Medical scanner eject collision fix (#767)
* MedicalScanner ejection location * MedicalScanner bounding box change
This commit is contained in:
@@ -9,6 +9,7 @@ using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Medical
|
||||
@@ -20,6 +21,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
private AppearanceComponent _appearance;
|
||||
private BoundUserInterface _userInterface;
|
||||
private ContainerSlot _bodyContainer;
|
||||
private readonly Vector2 _ejectOffset = new Vector2(-0.5f, 0f);
|
||||
public bool IsOccupied => _bodyContainer.ContainedEntity != null;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -160,7 +162,9 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
|
||||
public void EjectBody()
|
||||
{
|
||||
_bodyContainer.Remove(_bodyContainer.ContainedEntity);
|
||||
var containedEntity = _bodyContainer.ContainedEntity;
|
||||
_bodyContainer.Remove(containedEntity);
|
||||
containedEntity.Transform.WorldPosition += _ejectOffset;
|
||||
UpdateUserInterface();
|
||||
UpdateAppearance();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
- type: Collidable
|
||||
shapes:
|
||||
- !type:PhysShapeAabb
|
||||
bounds: "-0.5,-0.25,0.5,0.25"
|
||||
bounds: "-0.5,0,0.5,1"
|
||||
layer: 15
|
||||
IsScrapingFloor: true
|
||||
- type: Physics
|
||||
|
||||
Reference in New Issue
Block a user