Beispiel #1
0
 def setup_result(res_list: List[Property],
                  result: Property,
                  source: str = '') -> None:
     """Helper method to perform result setup."""
     func = RESULT_SETUP.get(result.name)
     if func:
         # noinspection PyBroadException
         try:
             result.value = func(VMF, result)
         except:
             # Print the source of the condition if if fails...
             LOGGER.exception(
                 'Error in {} setup:',
                 source or 'condition',
             )
             if utils.DEV_MODE:
                 # Crash so this is immediately noticable..
                 utils.quit_app(1)
             else:
                 # In release, just skip this one - that way it's
                 # still hopefully possible to run the game.
                 result.value = None
         if result.value is None:
             # This result is invalid, remove it.
             res_list.remove(result)
Beispiel #2
0
 def setup_result(res_list: List[Property], result: Property, source: Optional[str]='') -> None:
     """Helper method to perform result setup."""
     func = RESULT_SETUP.get(result.name)
     if func:
         # noinspection PyBroadException
         try:
             result.value = func(VMF, result)
         except:
             # Print the source of the condition if if fails...
             LOGGER.exception(
                 'Error in {} setup:',
                 source or 'condition',
             )
             if utils.DEV_MODE:
                 # Crash so this is immediately noticable..
                 utils.quit_app(1)
             else:
                 # In release, just skip this one - that way it's
                 # still hopefully possible to run the game.
                 result.value = None
         if result.value is None:
             # This result is invalid, remove it.
             res_list.remove(result)