Machine construction can now use tags. (#3532)

* work on machine tags

* Makes protolathe board use tag requirements
This commit is contained in:
Vera Aguilera Puerto
2021-03-08 05:09:30 +01:00
committed by GitHub
parent 13e95ac9a8
commit f5396344ef
5 changed files with 95 additions and 15 deletions

View File

@@ -113,6 +113,17 @@ namespace Content.Server.GameObjects.Components.Construction
throw new Exception($"Couldn't insert machine component part with default prototype '{compName}' to machine with prototype {Owner.Prototype?.ID ?? "N/A"}");
}
}
foreach (var (tagName, info) in machineBoard.TagRequirements)
{
for (var i = 0; i < info.Amount; i++)
{
var c = entityManager.SpawnEntity(info.DefaultPrototype, Owner.Transform.Coordinates);
if(!partContainer.Insert(c))
throw new Exception($"Couldn't insert machine component part with default prototype '{tagName}' to machine with prototype {Owner.Prototype?.ID ?? "N/A"}");
}
}
}
public void MapInit()