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

URL: http://svn.gna.org/viewcvs/freeciv?rev=27235&view=rev
Log:
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

Modified: trunk/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/control.c?rev=27235&r1=27234&r2=27235&view=diff
==============================================================================
--- 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
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to