From 0ee51a8c9737fc15cc84237a0ec7aa21646b329e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 16 Apr 2024 00:18:51 +0300 Subject: [PATCH 55/55] 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..5547b3f756 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)->id, "", + action_number(action_list_get(list, 0))); + } else { + unit_activity_targeted_internal(punit, new_activity, new_target, + trigger_action); + } } return TRUE; -- 2.43.0