Skip to content

Skip empty sound sources during sound autodetection#1205

Open
Copilot wants to merge 2 commits into
developfrom
copilot/fix-empty-sound-source-issue
Open

Skip empty sound sources during sound autodetection#1205
Copilot wants to merge 2 commits into
developfrom
copilot/fix-empty-sound-source-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Autodetecting sounds from placed sound sources was treating unassigned sound sources as real sound IDs and adding the internal sentinel value -1 to SelectedSounds. This caused the sound list UI to surface a bogus -1 entry when empty sound sources existed in the map.

  • Behavior change

    • AssignSoundSourcesSounds now ignores empty SoundSourceInstances instead of copying their sentinel ID into level sound selection.
  • Why this is the correct boundary

    • Empty sound sources are already modeled explicitly via SoundSourceInstance.IsEmpty.
    • Other code paths already treat -1 as "no sound assigned", so autodetection now follows the same contract instead of leaking the sentinel into user-facing selection state.
  • Scope

    • The change is isolated to sound-source-based autodetection.
    • Assigned sound sources continue to contribute their real sound IDs unchanged.
var soundSource = instance as SoundSourceInstance;
if (soundSource.IsEmpty)
    continue;

if (!settings.SelectedSounds.Contains(soundSource.SoundId))
    settings.SelectedSounds.Add(soundSource.SoundId);

Copilot AI changed the title [WIP] Fix sound auto-detection adding entry for empty sound source Skip empty sound sources during sound autodetection Apr 19, 2026
Copilot AI requested a review from Nickelony April 19, 2026 21:46
@Nickelony Nickelony requested a review from Lwmte April 19, 2026 21:48
@Nickelony Nickelony added bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review. labels Apr 19, 2026
@Nickelony Nickelony marked this pull request as ready for review April 19, 2026 21:48
@Nickelony Nickelony added this to the Version 2.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TE: sound auto-detection adds sound "-1" if empty sound source is found on the map

2 participants