public static bool PassingShipTick(TradeShip __instance) { --__instance.ticksUntilDeparture; if (__instance.Departed) { __instance.Depart(); } int index = Interlocked.Increment(ref totalTradeShipsCount) - 1; ThingOwner thingsOwner = __instance.things; tradeShips[index].TradeShipThings = thingsOwner; Interlocked.Add(ref totalTradeShipTicks, thingsOwner.Count); tradeShips[index].TradeShipTicks = totalTradeShipTicks; return(false); }