diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 5824dd60f..75c724b8f 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index a2f834e30..37e0d5e2a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -152,8 +152,11 @@ public class ShatteredPixelDungeon extends Game { Sample.INSTANCE.enable( soundFx() ); Sample.INSTANCE.volume( SFXVol()/10f ); - TelephonyManager mgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); - mgr.listen(Music.callMute, PhoneStateListener.LISTEN_CALL_STATE); + //versions lower than this require READ_PHONE_STATE permission + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + TelephonyManager mgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); + mgr.listen(Music.callMute, PhoneStateListener.LISTEN_CALL_STATE); + } Sample.INSTANCE.load( Assets.SND_CLICK, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java index 5f2940801..55bb5c3e5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java @@ -174,7 +174,7 @@ public class CavesLevel extends RegularLevel { @Override public void update() { - if (visible = Dungeon.level.heroFOV[pos]) { + if (visible = (pos < Dungeon.level.heroFOV.length && Dungeon.level.heroFOV[pos])) { super.update(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java index 34bfa1f70..6a15e6cd7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java @@ -184,7 +184,7 @@ public class CityLevel extends RegularLevel { @Override public void update() { - if (visible = Dungeon.level.heroFOV[pos]) { + if (visible = (pos < Dungeon.level.heroFOV.length && Dungeon.level.heroFOV[pos])) { super.update(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java index 43bb739e9..e6aec2f0c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java @@ -181,7 +181,7 @@ public class HallsLevel extends RegularLevel { @Override public void update() { - if (visible = Dungeon.level.heroFOV[pos]) { + if (visible = (pos < Dungeon.level.heroFOV.length && Dungeon.level.heroFOV[pos])) { super.update(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java index e71a33172..5ae87a60f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java @@ -137,7 +137,7 @@ public class ChangesScene extends PixelScene { changes.addButton( new ChangeButton(Icons.get(Icons.PREFS), Messages.get(this, "misc"), "_-_ Improved the formatting of older updates in the changes list. More information will be added to fill these out in future updates.\n\n" + "_-_ Slightly reduced the chance for items to appear in locked chests.\n\n" + - "_-_ Game music now mutes itself during phone calls")); + "_-_ Game music now mutes itself during phone calls on android 6.0+")); changes.addButton( new ChangeButton(new Image(Assets.SPINNER, 144, 0, 16, 16), Messages.get(this, "bugfixes"), "Fixed (caused by 0.6.2):\n" +