Prechádzať zdrojové kódy

Fixed hashcode for empty hotkeys

ManlyMarco 5 rokov pred
rodič
commit
b60442ed5e
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      BepInEx/Configuration/KeyboardShortcut.cs

+ 2 - 2
BepInEx/Configuration/KeyboardShortcut.cs

@@ -172,11 +172,11 @@ namespace BepInEx.Configuration
 		/// <inheritdoc />
 		public override int GetHashCode()
 		{
-			if (_allKeys == null || _allKeys.Length == 0) return 0;
+			if (MainKey == KeyCode.None) return 0;
 
 			var hc = _allKeys.Length;
 			for (var i = 0; i < _allKeys.Length; i++)
-				hc = unchecked(hc * 31 + (int)_allKeys[i]);
+				hc = unchecked(hc * 31 + (int)i);
 			return hc;
 		}
 	}