Skip to content

Commit

Permalink
Fix issue preventing building projects containing a "Play Music" even…
Browse files Browse the repository at this point in the history
…t but no music
  • Loading branch information
chrismaltby committed Sep 13, 2024
1 parent a70c864 commit 6a8f359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix issue where adding a new song wouldn't warn about unsaved changes in current song
- Fix issue where adding a song with an already existing name wouldn't auto select the newly created song
- Fix issue where scene connection lines could get stuck in place if custom scripts that change scenes are called multiple times from the same scene
- Fix issue where "Replace Script" confirmation alert would appear when pasting sometimes even if the custom script hadn't been modified
- Fix issue where "Replace Script" confirmation alert would appear when pasting sometimes even if the custom script hadn't been modified
- Fix issue preventing building projects containing a "Play Music" event but no music

## [4.1.2] - 2024-09-09

Expand Down
6 changes: 3 additions & 3 deletions src/lib/compiler/compileData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -882,9 +882,9 @@ export const precompileMusic = (
cmd.args &&
(cmd.args.musicId !== undefined || cmd.command === EVENT_MUSIC_PLAY)
) {
const musicId = ensureString(cmd.args.musicId, music[0].id);
const musicId = ensureString(cmd.args.musicId, music[0]?.id ?? "");
// If never seen this track before add it to the list
if (usedMusicIds.indexOf(musicId) === -1) {
if (musicId.length > 0 && usedMusicIds.indexOf(musicId) === -1) {
usedMusicIds.push(musicId);
}
} else if (eventHasArg(cmd, "references")) {
Expand Down Expand Up @@ -913,7 +913,7 @@ export const precompileMusic = (
id: track.id,
};
})
.filter((track) => track)
.filter((track) => track.symbol)
.map((track) => {
return {
...track,
Expand Down

0 comments on commit 6a8f359

Please sign in to comment.