From 85b2ce73738fca31f2a259efdf5be8a72ef24f78 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 19 Feb 2021 15:52:07 -0500 Subject: [PATCH] v0.9.2: added a safety check to Tengu shocker save/load --- .../shatteredpixeldungeon/actors/mobs/NewTengu.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java index 3d7c6dd68..df33838cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java @@ -972,14 +972,14 @@ public class NewTengu extends Mob { public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); bundle.put( SHOCKER_POS, shockerPos ); - bundle.put( SHOCKING_ORDINALS, shockingOrdinals ); + if (shockingOrdinals != null) bundle.put( SHOCKING_ORDINALS, shockingOrdinals ); } @Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); shockerPos = bundle.getInt( SHOCKER_POS ); - shockingOrdinals = bundle.getBoolean( SHOCKING_ORDINALS ); + if (bundle.contains(SHOCKING_ORDINALS)) shockingOrdinals = bundle.getBoolean( SHOCKING_ORDINALS ); } public static class ShockerBlob extends Blob {