From 571acc76ffad83d852836b6ce4893bdabeac0a40 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 19 Jul 2022 14:59:26 -0400 Subject: [PATCH] v1.3.2: fixed sheep not bundling their lifespan value --- .../actors/mobs/npcs/Sheep.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Sheep.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Sheep.java index a1d7c82c0..c89c19aa5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Sheep.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Sheep.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.SheepSprite; import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Bundle; import com.watabou.utils.Random; public class Sheep extends NPC { @@ -84,4 +85,18 @@ public class Sheep extends NPC { } return true; } + + private static final String LIFESPAN = "lifespan"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(LIFESPAN, lifespan); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + lifespan = bundle.getInt(LIFESPAN); + } } \ No newline at end of file