Skip to content

Commit b870ef6

Browse files
committed
Fix infinite tempo bug
- Fixed a bug where the near win condition song speed increase would be infinite, causing the game to freeze.
1 parent 505fc87 commit b870ef6

File tree

4 files changed

+705
-8
lines changed

4 files changed

+705
-8
lines changed

base-hack/Build/install_packages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
for pkg in installed_packages_list:
1414
print("-", pkg)
1515
pkg_data = pkg.split("==")
16-
current_packages.append({"name": pkg_data[0], "version": pkg_data[1]})
16+
if len(pkg_data) > 1:
17+
current_packages.append({"name": pkg_data[0], "version": pkg_data[1]})
1718

1819
print("Checking Packages:")
1920
for req_pkg in required_build_packages:

base-hack/src/misc/music_text.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ void SpeedUpMusic(void) {
7272
// Checking items
7373
if (win_con == GOAL_KROOL) {
7474
win_con_item = REQITEM_KEY;
75-
win_con_count = 9; // Triggers upon picking up key 8
75+
win_con_count = 9; // Triggers upon picking up the 8th key
7676
} else if (win_con != GOAL_CUSTOMITEM) {
77-
// Goal is inelligible for speed up
77+
// Goal is ineligible for speed up
7878
return;
7979
}
8080
if (win_con_count < 2) {
@@ -90,10 +90,11 @@ void SpeedUpMusic(void) {
9090
songs song = SongInWriteSlot[i];
9191
if ((music_types[song] == SONGTYPE_BGM) && (song != SONG_BABOONBALLOON)) {
9292
int existing_tempo = getSongTempo(compactSequencePlayers[i]);
93-
float tempo = musicStorage[i]->division * compactSequencePlayers[i]->uspt;
94-
float targ_tempo = tempo / 1.5f;
95-
if (existing_tempo != targ_tempo) {
96-
alCSPSetTempo(compactSequencePlayers[i], targ_tempo);
93+
float current_inverse_division = compactSequencePlayers[i]->target->qnpt;
94+
float target_inverse_division = (1.0f / musicStorage[i]->division / 1.5f);
95+
if (current_inverse_division != target_inverse_division) {
96+
compactSequencePlayers[i]->target->qnpt = target_inverse_division;
97+
alCSPSetTempo(compactSequencePlayers[i], existing_tempo);
9798
}
9899
}
99100
}

randomizer/Patching/ApplyLocal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async def patching_response(data, from_patch_gen=False, lanky_from_history=False
293293
BooleanProperties(settings.camera_is_follow, 0xCB), # Free/Follow Cam
294294
BooleanProperties(settings.camera_is_not_inverted, 0xCC), # Inverted/Non-Inverted Camera
295295
BooleanProperties(settings.fps_display, 0x96), # FPS Display
296-
# BooleanProperties(settings.song_speed_near_win, 0x1B4), # Song Win Con Speedup
296+
BooleanProperties(settings.song_speed_near_win, 0x1B4), # Song Win Con Speedup
297297
BooleanProperties(settings.disable_flavor_text, 0xAF), # Disable Flavor Text
298298
BooleanProperties(settings.rainbow_ammo, 0x112), # Rainbow Ammo
299299
]

0 commit comments

Comments
 (0)