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:
@@ -17,6 +17,15 @@ class Housing():
|
||||
raise YallGotHousedException
|
||||
|
||||
|
||||
def check_housing_safe(self, world, thing):
|
||||
try:
|
||||
self.check_housing(world, thing)
|
||||
except YallGotHousedException:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.space = defaultdict(int, {
|
||||
Buildings.HOUSE: 5,
|
||||
|
||||
Reference in New Issue
Block a user