maybe fixed the weird crashes from bad text idk
This commit is contained in:
parent
8c47509c6c
commit
806a2e2700
|
@ -51,6 +51,7 @@ class game_strings_base(object):
|
|||
no_formats = strikeoutlooking + strikeoutswinging + doubleplay + walk + single + double + triple + homerun + grandslam
|
||||
|
||||
def activate(self, lastupdate, currentupdate, game):
|
||||
try:
|
||||
if "twopart" in lastupdate:
|
||||
for key, value in lastupdate.items():
|
||||
if key != "twopart":
|
||||
|
@ -65,6 +66,8 @@ class game_strings_base(object):
|
|||
})
|
||||
else:
|
||||
currentupdate["displaytext"] = f"{currentupdate['batter']} {self.format_gamestring(getattr(self, currentupdate['outcome'].name)[currentupdate['voiceindex']], currentupdate)}"
|
||||
except:
|
||||
game_strings_base().activate(lastupdate, currentupdate, game)
|
||||
|
||||
def check_for_twopart(self, gamestring):
|
||||
return gamestring in self.twoparts
|
||||
|
@ -105,6 +108,7 @@ class game_strings_base(object):
|
|||
pass
|
||||
|
||||
def stealing(self, currentupdate, runner, base_string, defender, is_successful):
|
||||
try:
|
||||
if is_successful:
|
||||
index = randrange(0, len(self.steal_success))
|
||||
text = self.steal_success[index]
|
||||
|
@ -124,6 +128,9 @@ class game_strings_base(object):
|
|||
currentupdate["steals"] = [text.format(*format_list)]
|
||||
else:
|
||||
currentupdate["steals"] = [text]
|
||||
except:
|
||||
game_strings_base().stealing(currentupdate, runner, base_string, defender, is_successful)
|
||||
|
||||
|
||||
|
||||
class TheGoddesses(game_strings_base):
|
||||
|
|
Loading…
Reference in a new issue