update (still bug remains)

This commit is contained in:
bridge
2025-09-24 01:13:14 +08:00
parent 3c3724c997
commit e5d8bf9bf4
5 changed files with 47 additions and 26 deletions

View File

@@ -157,6 +157,13 @@ class Avatar:
return None
action_name, action_params = self.next_actions.pop(0)
action = self.create_action(action_name)
while not action.is_doable and self.next_actions:
action_name, action_params = self.next_actions.pop(0)
action = self.create_action(action_name)
if not action.is_doable:
return None
self.cur_action_pair = (action, action_params)
try:
event = action.get_event(**action_params)
@@ -185,6 +192,7 @@ class Avatar:
action = self.create_action(action_name)
doable = action.is_doable
assert isinstance(doable, bool)
del action
return doable
async def act(self) -> List[Event]: