diff --git a/CHANGELOG.md b/CHANGELOG.md index de0580f51..1d051d8c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Added a soft dependency to the LocalizationCache mod so that it loads a bit earlier. This has no direct impact on Jötunn * Fixed the debug mode Jötunn ASCII art * Fixed AddComponentCopy was setting the name and tag of the Component's GameObject +* Fixed KeyHints for left hand items ## Version 2.14.5 * Fixed GUIManager assets not being properly initialized when later accessed, causing some elements to not show up diff --git a/JotunnLib/Managers/KeyHintManager.cs b/JotunnLib/Managers/KeyHintManager.cs index dd11d7374..a9e1ef750 100644 --- a/JotunnLib/Managers/KeyHintManager.cs +++ b/JotunnLib/Managers/KeyHintManager.cs @@ -432,7 +432,19 @@ bool UseCustomKeyHint() } // Get the current equipped item name - ItemDrop.ItemData item = Player.m_localPlayer.m_rightItem; + ItemDrop.ItemData item = null; + if (Player.m_localPlayer.m_rightItem != null) + { + item = Player.m_localPlayer.m_rightItem; + } + else if (Player.m_localPlayer.m_leftItem != null && Player.m_localPlayer.m_leftItem.m_shared.m_itemType != ItemDrop.ItemData.ItemType.Torch) + { + item = Player.m_localPlayer.m_leftItem; + } + else if (Player.m_localPlayer.m_unarmedWeapon) + { + item = Player.m_localPlayer.m_unarmedWeapon.m_itemData; + } if (!(item != null && (item.IsWeapon() || item.m_shared?.m_buildPieces != null))) { return false;