You can't construct without hands or when you can't interact anymore.

This commit is contained in:
Víctor Aguilera Puerto
2020-09-24 13:13:10 +02:00
parent d90c3295e6
commit 0657698485

View File

@@ -299,6 +299,8 @@ namespace Content.Server.GameObjects.EntitySystems
private void TryStartItemConstruction(IEntity placingEnt, string prototypeName) private void TryStartItemConstruction(IEntity placingEnt, string prototypeName)
{ {
if (!ActionBlockerSystem.CanInteract(placingEnt)) return;
var prototype = _prototypeManager.Index<ConstructionPrototype>(prototypeName); var prototype = _prototypeManager.Index<ConstructionPrototype>(prototypeName);
if (prototype.Stages.Count < 2) if (prototype.Stages.Count < 2)
@@ -313,7 +315,8 @@ namespace Content.Server.GameObjects.EntitySystems
} }
// Try to find the stack with the material in the user's hand. // Try to find the stack with the material in the user's hand.
var hands = placingEnt.GetComponent<HandsComponent>(); if (!placingEnt.TryGetComponent(out HandsComponent hands)) return;
var activeHand = hands.GetActiveHand?.Owner; var activeHand = hands.GetActiveHand?.Owner;
if (activeHand == null) if (activeHand == null)
{ {