fix rcd overlay getting stuck for borg modules (#41648)
fix rcd overlay getting stuck
This commit is contained in:
parent
04c5406e20
commit
61c58a6341
1 changed files with 7 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ public sealed class RCDConstructionGhostSystem : EntitySystem
|
||||||
[Dependency] private readonly IPlacementManager _placementManager = default!;
|
[Dependency] private readonly IPlacementManager _placementManager = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||||
[Dependency] private readonly HandsSystem _hands = default!;
|
[Dependency] private readonly HandsSystem _hands = default!;
|
||||||
|
|
||||||
private Direction _placementDirection = default;
|
private Direction _placementDirection = default;
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
|
|
@ -42,6 +42,11 @@ public sealed class RCDConstructionGhostSystem : EntitySystem
|
||||||
|
|
||||||
var heldEntity = _hands.GetActiveItem(player);
|
var heldEntity = _hands.GetActiveItem(player);
|
||||||
|
|
||||||
|
// Don't open the placement overlay for client-side RCDs.
|
||||||
|
// This may happen when predictively spawning one in your hands.
|
||||||
|
if (heldEntity != null && IsClientSide(heldEntity.Value))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!TryComp<RCDComponent>(heldEntity, out var rcd))
|
if (!TryComp<RCDComponent>(heldEntity, out var rcd))
|
||||||
{
|
{
|
||||||
// If the player was holding an RCD, but is no longer, cancel placement
|
// If the player was holding an RCD, but is no longer, cancel placement
|
||||||
|
|
@ -69,7 +74,7 @@ public sealed class RCDConstructionGhostSystem : EntitySystem
|
||||||
MobUid = heldEntity.Value,
|
MobUid = heldEntity.Value,
|
||||||
PlacementOption = PlacementMode,
|
PlacementOption = PlacementMode,
|
||||||
EntityType = prototype.Prototype,
|
EntityType = prototype.Prototype,
|
||||||
Range = (int) Math.Ceiling(SharedInteractionSystem.InteractionRange),
|
Range = (int)Math.Ceiling(SharedInteractionSystem.InteractionRange),
|
||||||
IsTile = (prototype.Mode == RcdMode.ConstructTile),
|
IsTile = (prototype.Mode == RcdMode.ConstructTile),
|
||||||
UseEditorContext = false,
|
UseEditorContext = false,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue