Author: sveinung
Date: Sun Aug  9 00:48:59 2015
New Revision: 29410

URL: http://svn.gna.org/viewcvs/freeciv?rev=29410&view=rev
Log:
Consider evaluator omniscience when evaluating hard action requirements

See patch #6190

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=29410&r1=29409&r2=29410&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Sun Aug  9 00:48:59 2015
@@ -497,8 +497,8 @@
   When adding a new hard requirement here:
    * explain why it is a hard requirment in a comment.
    * remember that this is called from action_prob(). Should information
-     the player don't have access to be used in a test the way this
-     function is used must change.
+     the player don't have access to be used in a test it must check if
+     this evaluation is omniscient.
 **************************************************************************/
 static bool is_action_possible(const enum gen_action wanted_action,
                               const struct player *actor_player,
@@ -516,7 +516,8 @@
                               const struct unit *target_unit,
                               const struct unit_type *target_unittype,
                               const struct output_type *target_output,
-                              const struct specialist *target_specialist)
+                               const struct specialist *target_specialist,
+                               const bool omniscient)
 {
   fc_assert_msg((action_get_target_kind(wanted_action) == ATK_CITY
                  && target_city != NULL)
@@ -822,7 +823,8 @@
                           target_player, target_city,
                           target_building, target_tile,
                           target_unit, target_unittype,
-                          target_output, target_specialist)) {
+                          target_output, target_specialist,
+                          TRUE)) {
     /* The action enablers are irrelevant since the action it self is
      * impossible. */
     return FALSE;
@@ -1297,7 +1299,8 @@
                           target_player, target_city,
                           target_building, target_tile,
                           target_unit, target_unittype,
-                          target_output, target_specialist)) {
+                          target_output, target_specialist,
+                          FALSE)) {
     /* The action enablers are irrelevant since the action it self is
      * impossible. */
     return ACTPROB_IMPOSSIBLE;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to