private void Process(ClientFabricatorPickup msg) { var fabricator = GuidHelper.FindComponentInChildren <Fabricator>(msg.fabricatorGuid, true); if (fabricator == null) { Log.Info("Couldn't find fabricator: " + msg.fabricatorGuid); return; } var crafterLogic = fabricator.crafterLogic; if (crafterLogic == null) { return; } if (crafterLogic.numCrafted > 0) { crafterLogic.numCrafted -= 1; if (crafterLogic.numCrafted == 0) { crafterLogic.Reset(); } } }
public static void FabricatorPickup(GameObject gameObject, TechType tech) { if (Multiplayer.main.blocked) { return; } var res = new ClientFabricatorPickup(); res.fabricatorGuid = GuidHelper.Get(gameObject); res.tech = tech; Multiplayer.main.Send(res); }