# HG changeset patch # User Neil Muller # Date 1283008044 -7200 # Node ID 4e939b3c73f867ae208d8836c721a076c500054e # Parent 9d97d2e338db4cbc15421ee1c35ae8a25aeb1c4c Allow Nones in list of results diff -r 9d97d2e338db -r 4e939b3c73f8 gamelib/scenes/crew_quarters.py --- a/gamelib/scenes/crew_quarters.py Sat Aug 28 16:56:09 2010 +0200 +++ b/gamelib/scenes/crew_quarters.py Sat Aug 28 17:07:24 2010 +0200 @@ -87,16 +87,13 @@ # TODO: Wax lyrical some more about safecracking. self.set_data('is_cracked', True) self.set_interact('full_safe') - open_result = Result("Even after centuries of neglect, the tumblers slide" + return (Result("Even after centuries of neglect, the tumblers slide" " almost silently into place. Turns out the combination" " was '1 2 3 4 5'. An idiot must keep his luggage in" - " here.") - ai_result = make_jim_dialog("Prisoner %s, you have been observed commiting a felony violation. " - "This will go onto your permenant record, and your sentence may be extended by up to twenty years." - % PLAYER_ID, self.state) - if ai_result: - return open_result, ai_result - return open_result + " here."), + make_jim_dialog("Prisoner %s, you have been observed commiting a felony violation. " + "This will go onto your permenant record, and your sentence may be extended by up to twenty years." + % PLAYER_ID, self.state)) def get_description(self): return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." diff -r 9d97d2e338db -r 4e939b3c73f8 gamelib/scenes/cryo.py --- a/gamelib/scenes/cryo.py Sat Aug 28 16:56:09 2010 +0200 +++ b/gamelib/scenes/cryo.py Sat Aug 28 17:07:24 2010 +0200 @@ -165,15 +165,11 @@ self.state.add_item(pipe) self.state.add_inventory_item(pipe.name) self.set_interact("chopped") - result = Result("It takes more effort than one would expect, but " - "eventually the pipe is separated from the wall.") - ai_result = make_jim_dialog("Prisoner %s. Vandalism is an offence " - "punishable by a minimum of an additional 6 months " - "to your sentence" % PLAYER_ID, self.state) - if ai_result: - return result, ai_result - return result - + return (Result("It takes more effort than one would expect, but " + "eventually the pipe is separated from the wall."), + make_jim_dialog("Prisoner %s. Vandalism is an offence " + "punishable by a minimum of an additional 6 months " + "to your sentence" % PLAYER_ID, self.state)) def is_interactive(self): return self.get_data('fixed') diff -r 9d97d2e338db -r 4e939b3c73f8 gamelib/state.py --- a/gamelib/state.py Sat Aug 28 16:56:09 2010 +0200 +++ b/gamelib/state.py Sat Aug 28 17:07:24 2010 +0200 @@ -43,7 +43,9 @@ result.process(scene_widget) else: for res in result: - res.process(scene_widget) + if res: + # List may contain None's + res.process(scene_widget) def initial_state():