forked from p15670423/monkey
Island: append should agent die check to also check if monkey is marked dead in configuration
This commit is contained in:
parent
ea621b49d1
commit
9031bfb888
|
@ -23,8 +23,16 @@ def set_stop_all(time: float):
|
||||||
agent_controls.save()
|
agent_controls.save()
|
||||||
|
|
||||||
|
|
||||||
def was_monkey_killed(guid: int) -> bool:
|
def should_agent_die(guid: int) -> bool:
|
||||||
monkey = Monkey.objects(guid=guid).first()
|
monkey = Monkey.objects(guid=guid).first()
|
||||||
|
return _is_monkey_marked_dead(monkey) or _is_monkey_killed_manually()
|
||||||
|
|
||||||
|
|
||||||
|
def _is_monkey_marked_dead(monkey: Monkey) -> bool:
|
||||||
|
return monkey.config.alive
|
||||||
|
|
||||||
|
|
||||||
|
def _is_monkey_killed_manually(monkey: Monkey) -> bool:
|
||||||
if monkey.has_parent():
|
if monkey.has_parent():
|
||||||
launch_timestamp = monkey.get_parent().launch_time
|
launch_timestamp = monkey.get_parent().launch_time
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue