add many item and inventory related hooks
This commit is contained in:
@@ -523,6 +523,11 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
|
||||
var should = new LuaResult(GameMain.Lua.hook.Call("inventoryPutItem", new object[] { this, item, user, i, removeItem }));
|
||||
|
||||
if (should.Bool())
|
||||
return;
|
||||
|
||||
if (Owner == null) { return; }
|
||||
|
||||
Inventory prevInventory = item.ParentInventory;
|
||||
@@ -624,6 +629,11 @@ namespace Barotrauma
|
||||
{
|
||||
if (item?.ParentInventory == null || !slots[index].Any()) { return false; }
|
||||
|
||||
var should = new LuaResult(GameMain.Lua.hook.Call("inventoryItemSwap", new object[] { this, item, user, index, swapWholeStack }));
|
||||
|
||||
if (!should.IsNull())
|
||||
return should.Bool();
|
||||
|
||||
//swap to InvSlotType.Any if possible
|
||||
Inventory otherInventory = item.ParentInventory;
|
||||
bool otherIsEquipped = false;
|
||||
|
||||
Reference in New Issue
Block a user