fix mutual action interact with self bug

This commit is contained in:
bridge
2026-01-03 20:08:53 +08:00
parent f562d4ea81
commit 9cb98a61dd
2 changed files with 4 additions and 2 deletions

View File

@@ -143,6 +143,8 @@ class MutualAction(DefineAction, LLMAction, ActualActionMixin, TargetingMixin):
target = self._get_target_avatar(target_avatar)
if target is None:
return False, "目标不存在"
if target == self.avatar:
return False, "不能对自己发起互动"
# 调用子类的额外检查
return self._can_start(target)

View File

@@ -20,8 +20,8 @@ class Talk(MutualAction):
ACTION_NAME = "攀谈"
EMOJI = "👋"
DESC = "对方发起攀谈"
DOABLES_REQUIREMENTS = "目标在交互范围内"
DESC = "某人发起攀谈,对象不能是自己"
DOABLES_REQUIREMENTS = "对象在交互范围内"
PARAMS = {"target_avatar": "AvatarName"}
FEEDBACK_ACTIONS: list[str] = ["Talk", "Reject"]