private static void TransferLiquids(LiquidContainer from, LiquidContainer to) { LiquidContainerInfo liquidContainerInfo = (LiquidContainerInfo)from.m_Info; LiquidContainerInfo liquidContainerInfo2 = (LiquidContainerInfo)to.m_Info; if (liquidContainerInfo.m_LiquidType != liquidContainerInfo2.m_LiquidType) { if (liquidContainerInfo2.m_Amount >= 1f) { HUDMessages.Get().AddMessage(GreenHellGame.Instance.GetLocalization().Get("Liquids_Conflict", true), null, HUDMessageIcon.None, "", null); return; } liquidContainerInfo2.m_LiquidType = liquidContainerInfo.m_LiquidType; } float amount = liquidContainerInfo2.m_Amount; liquidContainerInfo2.m_Amount += liquidContainerInfo.m_Amount; liquidContainerInfo2.m_Amount = Mathf.Clamp(liquidContainerInfo2.m_Amount, 0f, liquidContainerInfo2.m_Capacity); float num = liquidContainerInfo2.m_Amount - amount; liquidContainerInfo.m_Amount -= num; to.ReplRequestOwnership(false); to.OnGet(); from.ReplRequestOwnership(false); from.OnPour(); }
private void TransferLiquids(LiquidContainer to) { LiquidContainerInfo liquidContainerInfo = (LiquidContainerInfo)to.m_Info; if (this.m_LiquidType != liquidContainerInfo.m_LiquidType) { if (liquidContainerInfo.m_Amount > 0f) { HUDMessages.Get().AddMessage(GreenHellGame.Instance.GetLocalization().Get("Liquids_Conflict", true), null, HUDMessageIcon.None, "", null); return; } liquidContainerInfo.m_LiquidType = this.m_LiquidType; } liquidContainerInfo.m_Amount = liquidContainerInfo.m_Capacity; to.OnGet(); to.ReplRequestOwnership(false); }