diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java index 6a4734dfce..c1cfe2406f 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -312,31 +312,32 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform @Override public void fileDropped(Fi file){ - if(!OS.isIos){ - if(file.extension().equalsIgnoreCase(saveExtension)){ //open save - try{ - if(SaveIO.isSaveValid(file)){ - SaveMeta meta = SaveIO.getMeta(new DataInputStream(new InflaterInputStream(file.read(Streams.defaultBufferSize)))); - if(meta.tags.containsKey("name")){ - //is map - if(!ui.editor.isShown()){ - ui.editor.show(); - } + if(OS.isIos) return; - ui.editor.beginEditMap(file); - }else if(meta.rules.sector == null){ //don't allow importing campaign saves, they are broken - SaveSlot slot = control.saves.importSave(file); - ui.load.runLoadSave(slot); - }else{ - ui.showErrorMessage("@save.nocampaign"); + if(file.extension().equalsIgnoreCase(saveExtension)){ //open save + try{ + if(SaveIO.isSaveValid(file)){ + SaveMeta meta = SaveIO.getMeta(new DataInputStream(new InflaterInputStream(file.read(Streams.defaultBufferSize)))); + if(meta.tags.containsKey("name")){ + //is map + if(!ui.editor.isShown()){ + ui.editor.show(); } + + ui.editor.beginEditMap(file); + }else if(meta.rules.sector == null){ //don't allow importing campaign saves, they are broken + SaveSlot slot = control.saves.importSave(file); + ui.load.runLoadSave(slot); }else{ - ui.showErrorMessage("@save.import.invalid"); + ui.showErrorMessage("@save.nocampaign"); } - }catch(Throwable e){ - ui.showException("@save.import.fail", e); + }else{ + ui.showErrorMessage("@save.import.invalid"); } + }catch(Throwable e){ + ui.showException("@save.import.fail", e); } } + } } diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index c584a92125..fbbd502826 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -198,7 +198,7 @@ public class NetClient implements ApplicationListener{ public static void sound(Sound sound, float volume, float pitch, float pan){ if(sound == null || headless) return; - sound.play(Mathf.clamp(volume, 0, 8f) * Core.settings.getInt("sfxvol") / 100f, Mathf.clamp(pitch, 0f, 20f), pan, false, false); + sound.play(Mathf.clamp(volume, 0, 8f) * Core.audio.sfxVolume, Mathf.clamp(pitch, 0f, 20f), pan, false, false); } @Remote(variants = Variant.both, unreliable = true, called = Loc.server) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 7dd2801b33..3c5dfea51e 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -2033,7 +2033,7 @@ public class LExecutor{ if(positional){ sound.at(World.unconv(x.numf()), World.unconv(y.numf()), pitch.numf(), Math.min(volume.numf(), 2f), limit.bool()); }else{ - sound.play(Math.min(volume.numf() * (Core.settings.getInt("sfxvol") / 100f), 2f), pitch.numf(), pan.numf(), false, limit.bool()); + sound.play(Math.min(volume.numf() * Core.audio.sfxVolume, 2f), pitch.numf(), pan.numf(), false, limit.bool()); } } } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 7afd737ef3..95e5b698dc 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -658,7 +658,7 @@ public class CoreBlock extends StorageBlock{ public void playDestroySound(){ if(team.data().cores.size <= 1 && player != null && player.team() == team && state.rules.canGameOver){ //play at full volume when doing a game over - block.destroySound.play(block.destroySoundVolume, Mathf.random(block.destroyPitchMin, block.destroyPitchMax), 0f); + block.destroySound.play(block.destroySoundVolume * Core.audio.sfxVolume, Mathf.random(block.destroyPitchMin, block.destroyPitchMax), 0f); }else{ super.playDestroySound(); } diff --git a/gradle.properties b/gradle.properties index 60ae5cad24..92bc8ea7c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,4 @@ org.gradle.caching=true org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 android.enableR8.fullMode=false -archash=3e5d2eb442 +archash=039b13f434