Don't send network events
This commit is contained in:
		@@ -168,7 +168,7 @@ local function tryStackFabricator(character)
 | 
				
			|||||||
	local previous = nil
 | 
						local previous = nil
 | 
				
			||||||
	for _, item in ipairs(items) do
 | 
						for _, item in ipairs(items) do
 | 
				
			||||||
		if previous ~= item.Prefab.Identifier then slot = slot + 1 end
 | 
							if previous ~= item.Prefab.Identifier then slot = slot + 1 end
 | 
				
			||||||
		local moved = inputInventory.TryPutItem(item, slot, false, true, Character.Controlled, true)
 | 
							local moved = inputInventory.TryPutItem(item, slot, false, true, nil)
 | 
				
			||||||
		if not moved then
 | 
							if not moved then
 | 
				
			||||||
			MyModGlobal.debugPrint(string.format("Failed to move %s", item.Prefab.Identifier.Value))
 | 
								MyModGlobal.debugPrint(string.format("Failed to move %s", item.Prefab.Identifier.Value))
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -164,7 +164,7 @@ local function tryReloadSlot(slot, preferMinCondition)
 | 
				
			|||||||
					break
 | 
										break
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				local moved = inventorySlot.inventory.TryPutItem(ititem, inventorySlot.slotIndex, false, true, Character.Controlled, true)
 | 
									local moved = inventorySlot.inventory.TryPutItem(ititem, inventorySlot.slotIndex, false, true, nil)
 | 
				
			||||||
				-- When the slot is full no more will be able to be moved
 | 
									-- When the slot is full no more will be able to be moved
 | 
				
			||||||
				-- And tat that point we're done with that slot
 | 
									-- And tat that point we're done with that slot
 | 
				
			||||||
				if not moved then break end
 | 
									if not moved then break end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,10 @@ local LOAD_MAP = {
 | 
				
			|||||||
	revolver = { revolverround = 999 },
 | 
						revolver = { revolverround = 999 },
 | 
				
			||||||
	underwaterscooter = battery,
 | 
						underwaterscooter = battery,
 | 
				
			||||||
	weldingtool = { weldingfueltank = 1 },
 | 
						weldingtool = { weldingfueltank = 1 },
 | 
				
			||||||
 | 
						exosuit = { fuelrot = 1, oxygentank = 1 },
 | 
				
			||||||
 | 
						healthscanner = battery,
 | 
				
			||||||
 | 
						portablepump = battery,
 | 
				
			||||||
 | 
						handcannon = { handcannonround = 999 },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return LOAD_MAP
 | 
					return LOAD_MAP
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,8 +126,7 @@ local function tryMoveItem(item, itemTree, force)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			if itemLocation.maxFits > 0 and canBePut then
 | 
								if itemLocation.maxFits > 0 and canBePut then
 | 
				
			||||||
				moved = moved or
 | 
									moved = moved or
 | 
				
			||||||
					itemLocation.inventory.TryPutItem(item, itemLocation.slotIndex, false, true, Character.Controlled,
 | 
										itemLocation.inventory.TryPutItem(item, itemLocation.slotIndex, false, true, nil)
 | 
				
			||||||
						true)
 | 
					 | 
				
			||||||
				if moved then
 | 
									if moved then
 | 
				
			||||||
					itemLocation.maxFits = itemLocation.inventory.HowManyCanBePut(item.Prefab, itemLocation.slotIndex)
 | 
										itemLocation.maxFits = itemLocation.inventory.HowManyCanBePut(item.Prefab, itemLocation.slotIndex)
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
@@ -160,8 +159,7 @@ local function tryMoveItem(item, itemTree, force)
 | 
				
			|||||||
			if maxFits > 0 then
 | 
								if maxFits > 0 then
 | 
				
			||||||
				-- MyModGlobal.debugPrint(string.format("Trying to move item to empty slot at index: %d", itemLocation.slotIndex))
 | 
									-- MyModGlobal.debugPrint(string.format("Trying to move item to empty slot at index: %d", itemLocation.slotIndex))
 | 
				
			||||||
				moved = moved or
 | 
									moved = moved or
 | 
				
			||||||
					itemLocation.inventory.TryPutItem(item, itemLocation.slotIndex, true, false, Character.Controlled,
 | 
										itemLocation.inventory.TryPutItem(item, itemLocation.slotIndex, true, false, nil)
 | 
				
			||||||
						true)
 | 
					 | 
				
			||||||
				if moved then
 | 
									if moved then
 | 
				
			||||||
					itemLocation.maxFits = itemLocation.inventory.HowManyCanBePut(item.Prefab, itemLocation.slotIndex)
 | 
										itemLocation.maxFits = itemLocation.inventory.HowManyCanBePut(item.Prefab, itemLocation.slotIndex)
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
@@ -379,8 +377,7 @@ local function stackToCursor()
 | 
				
			|||||||
			-- UPDATE: OK well that was a stupid idea, it returns an error for other shit as well
 | 
								-- UPDATE: OK well that was a stupid idea, it returns an error for other shit as well
 | 
				
			||||||
			-- What other shit? Wish I knew
 | 
								-- What other shit? Wish I knew
 | 
				
			||||||
			-- So we'll use HowManyCanBePut instead...
 | 
								-- So we'll use HowManyCanBePut instead...
 | 
				
			||||||
			local moved = slot.inventory.TryPutItem(ititem, slot.slotIndex - 1, false, true, Character.Controlled,
 | 
								local moved = slot.inventory.TryPutItem(ititem, slot.slotIndex - 1, false, true, nil)
 | 
				
			||||||
				true)
 | 
					 | 
				
			||||||
			if not moved then
 | 
								if not moved then
 | 
				
			||||||
				MyModGlobal.debugPrint(string.format("Failed to move item %s to slot %d", ititem.Name, slot
 | 
									MyModGlobal.debugPrint(string.format("Failed to move item %s to slot %d", ititem.Name, slot
 | 
				
			||||||
					.slotIndex - 1))
 | 
										.slotIndex - 1))
 | 
				
			||||||
@@ -440,8 +437,7 @@ local function stackAllToCursor()
 | 
				
			|||||||
				-- UPDATE: OK well that was a stupid idea, it returns an error for other shit as well
 | 
									-- UPDATE: OK well that was a stupid idea, it returns an error for other shit as well
 | 
				
			||||||
				-- What other shit? Wish I knew
 | 
									-- What other shit? Wish I knew
 | 
				
			||||||
				-- So we'll use HowManyCanBePut instead...
 | 
									-- So we'll use HowManyCanBePut instead...
 | 
				
			||||||
				local moved = slot.inventory.TryPutItem(ititem, slot.slotIndex - 1, false, true, Character.Controlled,
 | 
									local moved = slot.inventory.TryPutItem(ititem, slot.slotIndex - 1, false, true, nil)
 | 
				
			||||||
					true)
 | 
					 | 
				
			||||||
				if not moved then
 | 
									if not moved then
 | 
				
			||||||
					MyModGlobal.debugPrint(string.format("Failed to move item %s to slot %d", ititem.Name, slot
 | 
										MyModGlobal.debugPrint(string.format("Failed to move item %s to slot %d", ititem.Name, slot
 | 
				
			||||||
						.slotIndex - 1))
 | 
											.slotIndex - 1))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,7 +99,7 @@ local function tryUnloadSlot(slot)
 | 
				
			|||||||
			local canAccept = nearbySlot.inventory.CanBePutInSlot(iitem.Prefab, nearbySlot.slotIndex)
 | 
								local canAccept = nearbySlot.inventory.CanBePutInSlot(iitem.Prefab, nearbySlot.slotIndex)
 | 
				
			||||||
			if canAccept then
 | 
								if canAccept then
 | 
				
			||||||
				local moved = nearbySlot.inventory.TryPutItem(iitem, nearbySlot.slotIndex, true, false,
 | 
									local moved = nearbySlot.inventory.TryPutItem(iitem, nearbySlot.slotIndex, true, false,
 | 
				
			||||||
				Character.Controlled, true)
 | 
									nil)
 | 
				
			||||||
				-- print(string.format("Moved item %s to slot %d", iitem.Name, nearbySlot.slotIndex))
 | 
									-- print(string.format("Moved item %s to slot %d", iitem.Name, nearbySlot.slotIndex))
 | 
				
			||||||
				if moved then break end
 | 
									if moved then break end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user