From 8a724c04e060995eb046223b5b3df7a9796784f2 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Fri, 4 Dec 2020 21:33:29 -0600 Subject: [PATCH] fixed bug that didn't show wielded weapon after a reload --- typeclasses/characters.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/typeclasses/characters.py b/typeclasses/characters.py index 812e654..fa49fb0 100644 --- a/typeclasses/characters.py +++ b/typeclasses/characters.py @@ -10,7 +10,7 @@ import copy from world.conditions import HolyLight from world.utils.act import Announce, act -from world.utils.utils import delete_contents, is_equippable, is_obj, is_wiz, is_worn, apply_obj_effects, remove_obj_effects +from world.utils.utils import delete_contents, is_equippable, is_obj, is_wieldable, is_wielded, is_wiz, is_worn, apply_obj_effects, remove_obj_effects from world.gender import Gender from world.races import NoRace from world.attributes import Attribute, VitalAttribute @@ -57,11 +57,14 @@ def __init__(self, caller): self.location[loc.name] = None # obj # now try to find objects in caller.location - # that are 1) is_equippable and 2)is_worn + # that are 1) is_equippable and 2)is_worn or 3) is wieldable and 4) is_wielded for obj in self.caller.contents: - if is_equippable(obj) and is_worn(obj): + if (is_equippable(obj) and is_worn(obj)): self.location[obj.db.wear_loc] = obj + if (is_wieldable(obj) and is_wielded(obj)): + self.location['wield'] = obj + def add(self, obj): """ add piece of equipment from inventory to and make worn