Skip to content

Commit

Permalink
Merge pull request #15529 from LarryFrosty/bruh
Browse files Browse the repository at this point in the history
Fix `stopSound`, `pauseSound`, and `resumeSound`
  • Loading branch information
ShadowMario committed Sep 16, 2024
2 parents a6369c7 + dd08a07 commit 18f60ee
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions source/psychlua/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,10 @@ class FunkinLua {
});
Lua_helper.add_callback(lua, "stopSound", function(tag:String) {
if(tag == null || tag.length < 1)
if(FlxG.sound.music != null) FlxG.sound.music.stop();
{
if(FlxG.sound.music != null)
FlxG.sound.music.stop();
}
else
{
tag = LuaUtils.formatVariable('sound_$tag');
Expand All @@ -1356,7 +1359,10 @@ class FunkinLua {
});
Lua_helper.add_callback(lua, "pauseSound", function(tag:String) {
if(tag == null || tag.length < 1)
if(FlxG.sound.music != null) FlxG.sound.music.pause();
{
if(FlxG.sound.music != null)
FlxG.sound.music.pause();
}
else
{
tag = LuaUtils.formatVariable('sound_$tag');
Expand All @@ -1366,7 +1372,10 @@ class FunkinLua {
});
Lua_helper.add_callback(lua, "resumeSound", function(tag:String) {
if(tag == null || tag.length < 1)
if(FlxG.sound.music != null) FlxG.sound.music.play();
{
if(FlxG.sound.music != null)
FlxG.sound.music.play();
}
else
{
tag = LuaUtils.formatVariable('sound_$tag');
Expand Down

0 comments on commit 18f60ee

Please sign in to comment.