Update gameplay_helpers.py
Day 1 bug fixes
This commit is contained in:
parent
502759d6cd
commit
51fe57eac6
@ -285,6 +285,7 @@ def gb_result_2(this_play: StratPlay) -> Optional[int]:
|
||||
num_outs = 2 if this_play.starting_outs <= 1 else 1
|
||||
|
||||
patch_play(this_play.id, pa=1, ab=1, outs=num_outs, on_first_final=False)
|
||||
if num_outs + this_play.starting_outs < 3:
|
||||
if runner_on_second(this_play):
|
||||
advance_one_runner(this_play.id, from_base=2, num_bases=1)
|
||||
if runner_on_third(this_play):
|
||||
@ -295,6 +296,7 @@ def gb_result_2(this_play: StratPlay) -> Optional[int]:
|
||||
|
||||
def gb_result_3(this_play: StratPlay) -> Optional[int]:
|
||||
logging.info(f'GB 3')
|
||||
if this_play.starting_outs < 2:
|
||||
advance_runners(this_play.id, num_bases=1)
|
||||
patch_play(this_play.id, pa=1, ab=1, outs=1)
|
||||
return None
|
||||
@ -303,6 +305,7 @@ def gb_result_3(this_play: StratPlay) -> Optional[int]:
|
||||
def gb_result_4(this_play: StratPlay) -> Optional[int]:
|
||||
logging.info(f'GB 4')
|
||||
patch_play(this_play.id, pa=1, ab=1, outs=1, on_first_final=False)
|
||||
if this_play.starting_outs < 2:
|
||||
if runner_on_second(this_play):
|
||||
advance_one_runner(this_play.id, from_base=2, num_bases=1)
|
||||
if runner_on_third(this_play):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user