17 {
18 Torch torch;
19 Rag rag;
20 Rag torchRag;
21
22 if ((Class.CastTo(torch,target.GetObject()) && Class.CastTo(rag,item)) || (Class.CastTo(rag,target.GetObject()) && Class.CastTo(torch,item)))
23 {
24 if (Class.CastTo(torchRag,torch.GetRag()))
25 {
26 int slotId = InventorySlots.INVALID;
27 InventoryLocation lcn = new InventoryLocation();
28 torchRag.GetInventory().GetCurrentInventoryLocation(lcn);
30
31 return torch.GetInventory().GetSlotLock(slotId) && torch.GetRagQuantity() < torchRag.GetQuantityMax() && torch.IsRagDryEnough(rag);
32 }
33 }
34
35 return false;
36 }
proto native int GetSlot()
returns slot id if current type is Attachment