Skip to content

Commit

Permalink
More fixes for slot changes (#446)
Browse files Browse the repository at this point in the history
* Fix an error in `[p]loot` when the user tries to equip a 2h weapon or previously had a 2h weapon equipped

* Bump to 4.0.4
  • Loading branch information
TrustyJAID authored Jul 10, 2023
1 parent 4f50475 commit 4823374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adventure/adventure.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def red_delete_data_for_user(
user_id
).clear() # This will only ever touch the separate currency, leaving bot economy to be handled by core.

__version__ = "4.0.3"
__version__ = "4.0.4"

def __init__(self, bot: Red):
self.bot = bot
Expand Down
6 changes: 3 additions & 3 deletions adventure/loot.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ async def _open_chest(self, ctx: commands.Context, user: discord.User, chest_typ
)
return None
slot = item.slot
old_item = getattr(character, item.slot.name, None)
old_item = getattr(character, item.slot.char_slot, None)
old_stats = ""

if old_item:
Expand Down Expand Up @@ -520,7 +520,7 @@ async def _open_chest(self, ctx: commands.Context, user: discord.User, chest_typ
f"{bold(ctx.author.display_name)}, you need to be level "
f"`{equiplevel}` to equip this item. I've put it in your backpack.",
)
if not getattr(character, item.slot.name):
if not getattr(character, item.slot.char_slot):
equip_msg = box(
_("{user} equipped {item} ({slot} slot).").format(
user=escape(ctx.author.display_name), item=item, slot=slot
Expand All @@ -533,7 +533,7 @@ async def _open_chest(self, ctx: commands.Context, user: discord.User, chest_typ
user=escape(ctx.author.display_name),
item=item,
slot=slot,
old_item=getattr(character, item.slot.name),
old_item=getattr(character, item.slot.char_slot),
),
lang="ansi",
)
Expand Down

0 comments on commit 4823374

Please sign in to comment.