Skip to content

Fix currently playing audiofile resetting to the beginning when trying to play same audiofile again

Rey requested to merge TheRey/pokemonsdk:fix_audio_resetting into development

MR Description

  • This MR fixes a bug reported on the Discord. When a battle was using the same BGM as the map BGM currently playing, the BGM was reset to the beginning.
  • The cause lied in the fact the map BGM is launched with a capitalized "BGM" in its filename, while the battle bgm is initialized with a downcased "bgm". The easiest solution was to downcase both the old filename and the new filename for the comparison.

Before testing

  • Create a trainer in Studio. For the Battle BGM, select the BGM of the map the battle will occur on
  • Add an event that start a battle against this trainer. The event must directly launch the battle (so no trainer_eye_sequence!)

Tests to realize

  • Launch a battle against the created trainer: the music shouldn't be reset

Sources related to this MR

Merge request reports