Skip to content

Commit

Permalink
Merge pull request #34 from duysqubix/fix/#33-wielding-weapon-vanishe…
Browse files Browse the repository at this point in the history
…s-upon-reload

fixed bug that didn't show wielded weapon after a reload
  • Loading branch information
duysqubix committed Dec 5, 2020
2 parents e45f2b9 + 8a724c0 commit bbacdea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions typeclasses/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbacdea

Please sign in to comment.