Author: sveinung
Date: Wed Dec 10 14:29:46 2014
New Revision: 27235

Client: Make the sanity test in key_unit_build_wonder() stricter.

The common client code's function key_unit_build_wonder() checks that the actor
unit given to it by the client has the HelpWonder unit type flag before
forwarding the request to the server. This way the server won't be bothered by
theoretically impossible requests.

Because action enablers now control the help build wonder action it is possible
to have a unit type with the HelpWonder flag that never will be able to help a
city build a wonder. Change the test to check for the unit type's ability to do
the help build wonder action instead.

See patch #5517


Modified: trunk/client/control.c
--- trunk/client/control.c      (original)
+++ trunk/client/control.c      Wed Dec 10 14:29:46 2014
@@ -2735,7 +2735,7 @@
 void key_unit_build_wonder(void)
   unit_list_iterate(get_units_in_focus(), punit) {
-    if (unit_has_type_flag(punit, UTYF_HELP_WONDER)) {
+    if (unit_can_do_action(punit, ACTION_HELP_WONDER)) {
       request_unit_caravan_action(punit, ACTION_HELP_WONDER);
   } unit_list_iterate_end;

Freeciv-commits mailing list

Reply via email to