Fixed crash bug with snares and possibly in other places.

This commit is contained in:
Storm Dragon
2026-01-25 15:46:45 -05:00
parent f80e3263a3
commit 815ac97a64
19 changed files with 575 additions and 154 deletions

View File

@@ -202,6 +202,7 @@ void reset_game_state() {
incense_hours_remaining = 0;
incense_burning = false;
blessing_speed_active = false;
blessing_resident_active = false;
// Reset inventory using the registry system
reset_inventory();
@@ -978,7 +979,12 @@ bool load_game_state() {
bandits.insert_last(b);
// Start looping sound for loaded bandit
b.sound_handle = play_1d_with_volume_step(b.alert_sound, x, b.position, true, BANDIT_SOUND_VOLUME_STEP);
int[] areaStarts;
int[] areaEnds;
get_active_audio_areas(areaStarts, areaEnds);
if (areaStarts.length() == 0 || range_overlaps_active_areas(b.position, b.position, areaStarts, areaEnds)) {
b.sound_handle = play_1d_with_volume_step(b.alert_sound, x, b.position, true, BANDIT_SOUND_VOLUME_STEP);
}
}
string[] mountainData = get_string_list_or_split(saveData, "mountains_data");