v0.9.2: fixed cases where bad game settings could crash on desktop
This commit is contained in:
parent
44b80b24a9
commit
8992a492eb
|
@ -23,6 +23,7 @@ package com.watabou.utils;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.Preferences;
|
import com.badlogic.gdx.Preferences;
|
||||||
|
import com.watabou.noosa.Game;
|
||||||
|
|
||||||
public class GameSettings {
|
public class GameSettings {
|
||||||
|
|
||||||
|
@ -60,8 +61,8 @@ public class GameSettings {
|
||||||
} else {
|
} else {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
} catch (ClassCastException e) {
|
} catch (Exception e) {
|
||||||
//ShatteredPixelDungeon.reportException(e);
|
Game.reportException(e);
|
||||||
put(key, defValue);
|
put(key, defValue);
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +82,8 @@ public class GameSettings {
|
||||||
} else {
|
} else {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
} catch (ClassCastException e) {
|
} catch (Exception e) {
|
||||||
//ShatteredPixelDungeon.reportException(e);
|
Game.reportException(e);
|
||||||
put(key, defValue);
|
put(key, defValue);
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
@ -91,9 +92,8 @@ public class GameSettings {
|
||||||
public static boolean getBoolean( String key, boolean defValue ) {
|
public static boolean getBoolean( String key, boolean defValue ) {
|
||||||
try {
|
try {
|
||||||
return get().getBoolean(key, defValue);
|
return get().getBoolean(key, defValue);
|
||||||
} catch (ClassCastException e) {
|
} catch (Exception e) {
|
||||||
//ShatteredPixelDungeon.reportException(e);
|
Game.reportException(e);
|
||||||
put(key, defValue);
|
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,8 @@ public class GameSettings {
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
} catch (ClassCastException e) {
|
} catch (Exception e) {
|
||||||
//ShatteredPixelDungeon.reportException(e);
|
Game.reportException(e);
|
||||||
put(key, defValue);
|
put(key, defValue);
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user