Skip to content

Commit

Permalink
allow household sims to be removed #3
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Nov 15, 2019
1 parent 620bd95 commit 6c4b5f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/control_any_sim/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ def test(cls, inst, *args, target=DEFAULT, context=None, **kwargs) -> TestResult

Logger.log('info_target: {}'.format(info_target))

if cls.must_be_selectable(info_target):
return TestResult(False, "sim is in active household and has to be selectable")

sim_is_selectable = (SelectionGroupService
.get(0).is_selectable(info_target.id))

Expand Down
6 changes: 6 additions & 0 deletions src/control_any_sim/services/selection_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ def remove_sim(self, sim_info):
self.client.remove_selectable_sim_by_id(sim_info.id)

def setup_zone(self):
for sim_info in self.client.selectable_sims:
if sim_info.id in self.selectable_sims:
continue

self.remove_sim(sim_info)

for sim_info_id in self.selectable_sims:
try:
sim_info = services.sim_info_manager().get(sim_info_id)
Expand Down

0 comments on commit 6c4b5f4

Please sign in to comment.