7 m_Text =
"#STR_RefuelTorch0";
10 override void CreateConditionComponents()
22 if ((
Class.CastTo(torch,target.GetObject()) &&
Class.CastTo(rag,item)) || (
Class.CastTo(rag,target.GetObject()) &&
Class.CastTo(torch,item)))
24 if (
Class.CastTo(torchRag,torch.GetRag()))
28 torchRag.GetInventory().GetCurrentInventoryLocation(lcn);
29 slotId = lcn.GetSlot();
31 return torch.GetInventory().GetSlotLock(slotId) && torch.GetRagQuantity() < torchRag.GetQuantityMax() && torch.IsRagDryEnough(rag);
38 override void OnExecuteServer(
ActionData action_data)
44 if ((
Class.CastTo(torch,action_data.m_Target.GetObject()) &&
Class.CastTo(rag,action_data.m_MainItem)) || (
Class.CastTo(rag,action_data.m_Target.GetObject()) &&
Class.CastTo(torch,action_data.m_MainItem)))
46 Class.CastTo(torchRag,torch.GetRag());
48 int qtyTransfer = torchRag.GetQuantityMax() - torch.GetRagQuantity();
49 qtyTransfer = (
int)
Math.Clamp(rag.GetQuantity(),0,qtyTransfer);
50 torchRag.AddQuantity(qtyTransfer);
51 rag.AddQuantity(-qtyTransfer);