Allow user to choose whether getting housed is an error
Previously, the simulation would automatically end whenever it determined you were housed. That is still the default, but the user can now choose to have the simulation continue instead. Also, this likely fixes a bug whereby an error could have been thrown for an unavailable production building when searching the production queue.
This commit is contained in:
@@ -14,6 +14,15 @@ class Production():
|
||||
raise ProductionBuildingNotAvailableException
|
||||
|
||||
|
||||
def check_production_safe(self, world, thing):
|
||||
try:
|
||||
self.check_production(world, thing)
|
||||
except ProductionBuildingNotAvailableException:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
# assumes for now each unit can be built in only one type of building
|
||||
def __init__(self):
|
||||
self.building = defaultdict(None, {
|
||||
|
||||
Reference in New Issue
Block a user