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.Server.Interfaces.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Medical
|
namespace Content.Server.GameObjects.Components.Medical
|
||||||
@@ -20,6 +21,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
|||||||
private AppearanceComponent _appearance;
|
private AppearanceComponent _appearance;
|
||||||
private BoundUserInterface _userInterface;
|
private BoundUserInterface _userInterface;
|
||||||
private ContainerSlot _bodyContainer;
|
private ContainerSlot _bodyContainer;
|
||||||
|
private readonly Vector2 _ejectOffset = new Vector2(-0.5f, 0f);
|
||||||
public bool IsOccupied => _bodyContainer.ContainedEntity != null;
|
public bool IsOccupied => _bodyContainer.ContainedEntity != null;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -160,7 +162,9 @@ namespace Content.Server.GameObjects.Components.Medical
|
|||||||
|
|
||||||
public void EjectBody()
|
public void EjectBody()
|
||||||
{
|
{
|
||||||
_bodyContainer.Remove(_bodyContainer.ContainedEntity);
|
var containedEntity = _bodyContainer.ContainedEntity;
|
||||||
|
_bodyContainer.Remove(containedEntity);
|
||||||
|
containedEntity.Transform.WorldPosition += _ejectOffset;
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
UpdateAppearance();
|
UpdateAppearance();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
- type: Collidable
|
- type: Collidable
|
||||||
shapes:
|
shapes:
|
||||||
- !type:PhysShapeAabb
|
- !type:PhysShapeAabb
|
||||||
bounds: "-0.5,-0.25,0.5,0.25"
|
bounds: "-0.5,0,0.5,1"
|
||||||
layer: 15
|
layer: 15
|
||||||
IsScrapingFloor: true
|
IsScrapingFloor: true
|
||||||
- type: Physics
|
- type: Physics
|
||||||
|
|||||||
Reference in New Issue
Block a user