Fix currentSelectGameObject null check (dont use ?.); block swapping components on an equipped gun with each other in raid
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Aki.Reflection.Patching;
|
||||
using Aki.Reflection.Utils;
|
||||
using EFT;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.UI;
|
||||
using EFT.UI.DragAndDrop;
|
||||
@@ -381,6 +382,17 @@ namespace UIFixes
|
||||
return;
|
||||
}
|
||||
|
||||
// Swapping items with each other when both are on an equipped gun in raid doesn't work
|
||||
if (itemController is Player.PlayerInventoryController playerInventoryController)
|
||||
{
|
||||
Item item1 = __instance.Item.GetRootItem();
|
||||
Item item2 = targetItemContext.Item.GetRootItem();
|
||||
if (item1 == item2 && playerInventoryController.IsItemEquipped(item1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ValidPrerequisites(__instance, targetItemContext, operation))
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user