diff --git a/ShipyardsRevival/Data/Scripts/ShipyardMod/ProcessShipyardAction.cs b/ShipyardsRevival/Data/Scripts/ShipyardMod/ProcessShipyardAction.cs index 806d0fd..45caa4f 100644 --- a/ShipyardsRevival/Data/Scripts/ShipyardMod/ProcessShipyardAction.cs +++ b/ShipyardsRevival/Data/Scripts/ShipyardMod/ProcessShipyardAction.cs @@ -831,31 +831,20 @@ private bool BuildTarget(BlockTarget target, ShipyardItem item, IMyCubeBlock too { IMyProjector projector = target.Projector; IMySlimBlock block = target.Block; - + if (projector == null || block == null) return false; - + if (projector.CanBuild(block, false) != BuildCheckResult.OK) return false; - if (MyAPIGateway.Session.CreativeMode) - { - projector.Build(block, projector.OwnerId, projector.EntityId, false, projector.OwnerId); - return projector.CanBuild(block, true) != BuildCheckResult.OK; - } - - //try to remove the first component from inventory - string name = ((MyCubeBlockDefinition)block.BlockDefinition).Components[0].Definition.Id.SubtypeName; - if (_tmpInventory.PullAny(item.ConnectedCargo, name, 1)) - { - _tmpInventory.Clear(); - - projector.Build(block, projector.OwnerId, projector.EntityId, false, projector.OwnerId); + // Attempt to build the block, which places it into the world as a projected block + // but does not complete it unless components are supplied during welding + projector.Build(block, projector.OwnerId, projector.EntityId, false, projector.OwnerId); - return projector.CanBuild(block, true) != BuildCheckResult.OK; - } - - return false; + // Return true if the block is now placed into the world + return projector.CanBuild(block, true) != BuildCheckResult.OK; } + } } \ No newline at end of file