소스 검색

Fixed hashcode for empty hotkeys

ManlyMarco 5 년 전
부모
커밋
b60442ed5e
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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;
 		}
 	}