From 4d901b9a1c506b634b4085ad0e150ef4bf199786 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 16 Apr 2024 00:18:51 +0300 Subject: [PATCH 49/50] Trigger action system when client requests activity change Lacking action handling for some activities reported by bard See osdn #57670 Signed-off-by: Marko Lindqvist --- server/unithand.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/unithand.c b/server/unithand.c index 63f644aebf..e821b929a9 100644 --- a/server/unithand.c +++ b/server/unithand.c @@ -6681,9 +6681,19 @@ bool unit_activity_handling_targeted(struct unit *punit, unit_activity_handling(punit, new_activity, trigger_action); } else if (can_unit_do_activity_targeted(&(wld.map), punit, new_activity, *new_target)) { + struct action_list *list = action_list_by_activity(new_activity); + free_unit_orders(punit); - unit_activity_targeted_internal(punit, new_activity, new_target, - trigger_action); + + if (list != NULL && action_list_size(list) > 0) { + /* Trigger action system */ + unit_do_action(unit_owner(punit), punit->id, punit->tile->index, + (*new_target) != NULL ? (*new_target)->id : NO_TARGET, + "", action_number(action_list_get(list, 0))); + } else { + unit_activity_targeted_internal(punit, new_activity, new_target, + trigger_action); + } } return TRUE; -- 2.43.0