HaxeFlixel / HaxeFlixel/flixel
Call onComplete if _sound is null
Open
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
If _sound is null then return is simply called
function startSound(st:Float):Void {
if (_sound == null) return;
_time = st;
_paused = false;
_channel = _sound.play(_time, 0, _transform);
if(_channel != null) {
pitch = _pitch;
_channel.addEventListener(Event.SOUND_COMPLETE, stopped);
active = true;
} else exists = active = false;
}
Because of this some necessary functions aren't called
I suggest just calling these functions and I think it will be enough
if (_sound == null) {
if (onComplete != null) onComplete();
cleanup(autoDestroy);
return;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the startSound(st:Float) function and trace how onComplete and cleanup(autoDestroy) are normally invoked. Verify the null-_sound path invokes both before returning, and check the related sound behavior to confirm completion and cleanup occur as expected.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100