Skip to content

Commit 02f0311

Browse files
committed
fix: 之前的AddSort_PrefixSubSort_Prefix,对循环的处理和原始游戏不一致。
具体而言,当AddSort尝试切换超出范围时,官方游戏是会Clamp固定在最边上、不会循环回开头;但这个patch下,会使得行为变成循环。 然后,修复上述问题、改为和原版游戏行为一致后,会发现:`SubSort_Prefix`函数实际上没有作用、patch后的版本代码和原版游戏完全相同。因此直接删除即可。
1 parent 7f99cd4 commit 02f0311

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

AquaMai.Mods/GameSystem/SongConstantSort.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,7 @@ public static bool AddSort_Prefix(Process.MusicSelectProcess __instance, DB.Sort
174174
{
175175
if (root != DB.SortRootID.Tab) return true;
176176
int next = (int)(DB.SortTabID)_beforeSortField.GetValue(__instance) + 1;
177-
if (next >= ConstTabId.End) next = 0;
178-
_beforeSortField.SetValue(__instance, (DB.SortTabID)next);
179-
return false;
180-
}
181-
182-
[HarmonyPatch(typeof(Process.MusicSelectProcess), "SubSort")]
183-
[HarmonyPrefix]
184-
public static bool SubSort_Prefix(Process.MusicSelectProcess __instance, DB.SortRootID root)
185-
{
186-
if (root != DB.SortRootID.Tab) return true;
187-
int next = (int)(DB.SortTabID)_beforeSortField.GetValue(__instance) - 1;
188-
if (next < 0) next = ConstTabId.Value;
177+
if (next >= ConstTabId.End) next = ConstTabId.Value;
189178
_beforeSortField.SetValue(__instance, (DB.SortTabID)next);
190179
return false;
191180
}

0 commit comments

Comments
 (0)