From 9dbd7896c4f3f7062667ced1e54cdfcaebd7390e Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 25 Dec 2024 15:00:22 -0600 Subject: [PATCH] Add PB to catcher string Fix chaos interaction bug --- cogs/gameplay.py | 2 +- command_logic/logic_gameplay.py | 2 +- utilities/buttons.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/gameplay.py b/cogs/gameplay.py index f1f5f52..0806f7d 100644 --- a/cogs/gameplay.py +++ b/cogs/gameplay.py @@ -619,8 +619,8 @@ class Gameplay(commands.Cog): with Session(engine) as session: this_game, owner_team, this_play = await checks_log_interaction(session, interaction, command_name='log single') - this_play = await singles(session, interaction, this_play, single_type) logger.info(f'log single {single_type} - this_play: {this_play}') + this_play = await singles(session, interaction, this_play, single_type) await self.complete_and_post_play(session, interaction, this_play, buffer_message='Single logged' if ((this_play.on_first or this_play.on_second) and single_type == 'uncapped') else None) diff --git a/command_logic/logic_gameplay.py b/command_logic/logic_gameplay.py index b29256b..fef4348 100644 --- a/command_logic/logic_gameplay.py +++ b/command_logic/logic_gameplay.py @@ -201,7 +201,7 @@ async def get_scorebug_embed(session: Session, this_game: Game, full_length: boo else: log_exception(PositionNotFoundException, f'No catcher rating found for {curr_play.catcher.card.player.name}') - cat_string = f'{curr_play.catcher.player.name_card_link('batter')}\nArm: {catcher_rating.arm}' + cat_string = f'{curr_play.catcher.player.name_card_link('batter')}\nArm: {catcher_rating.arm}, PB: {catcher_rating.pb}' embed.add_field(name='Catcher', value=cat_string) if curr_play.ai_is_batting and curr_play.on_base_code > 0: diff --git a/utilities/buttons.py b/utilities/buttons.py index 5002a51..bd1cc1f 100644 --- a/utilities/buttons.py +++ b/utilities/buttons.py @@ -344,7 +344,7 @@ class ScorebugButtons(discord.ui.View): await interaction.channel.send(content=None, embeds=this_roll.embeds) - if this_roll.d_six_one > 3: + if this_roll.d_six_one is not None and this_roll.d_six_one > 3: logger.info(f'ScorebugButton - updating embed card to pitcher') self.embed.set_image(url=self.pitcher_card_url) logger.debug(f'embed image url: {self.embed.image}')