Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MassFarming/MassFarming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace MassFarming
{
[BepInPlugin("xeio.MassFarming", "MassFarming", "1.9")]
[BepInPlugin("xeio.MassFarming", "MassFarming", "1.10")]
public class MassFarming : BaseUnityPlugin
{
public static ConfigEntry<KeyboardShortcut> MassActionHotkey { get; private set; }
Expand Down
12 changes: 11 additions & 1 deletion MassFarming/MassPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ public static void Prefix(Player __instance, GameObject go, bool hold, bool alt)
return;
}

if (!Input.GetKey(MassFarming.ControllerPickupHotkey.Value.MainKey) && !Input.GetKey(MassFarming.MassActionHotkey.Value.MainKey))
var controllerKey = MassFarming.ControllerPickupHotkey.Value.MainKey;
var controllerKeyEmpty = controllerKey == KeyCode.None;
var controllerPressed = Input.GetKey(controllerKey);
var controllerOk = controllerKeyEmpty || controllerPressed;

var keyboardKey = MassFarming.MassActionHotkey.Value.MainKey;
var keyboardKeyEmpty = keyboardKey == KeyCode.None;
var keyboardPressed = Input.GetKey(keyboardKey);
var keyboardOk = keyboardKeyEmpty || keyboardPressed;

if (!controllerOk && !keyboardOk)
{
//Hotkey required
return;
Expand Down