From 947572522842624d9ad3882d5c8d115a1037f7a3 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 18 Dec 2020 17:50:26 +0100 Subject: [PATCH] Save equipped item and armor --- squirrelbattle/entities/player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/squirrelbattle/entities/player.py b/squirrelbattle/entities/player.py index d7c9e28..a370264 100644 --- a/squirrelbattle/entities/player.py +++ b/squirrelbattle/entities/player.py @@ -154,4 +154,8 @@ class Player(InventoryHolder, FightingEntity): d = super().save_state() d["current_xp"] = self.current_xp d["max_xp"] = self.max_xp + d["equipped_item"] = self.equipped_item.save_state()\ + if self.equipped_item else None + d["equipped_armor"] = self.equipped_armor.save_state()\ + if self.equipped_armor else None return d