Author: sveinung
Date: Sun Aug  9 01:16:50 2015
New Revision: 29414

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

See patch #6190

Modified:
    branches/S2_6/common/actions.c

Modified: branches/S2_6/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=29414&r1=29413&r2=29414&view=diff
==============================================================================
--- branches/S2_6/common/actions.c      (original)
+++ branches/S2_6/common/actions.c      Sun Aug  9 01:16:50 2015
@@ -394,8 +394,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,
@@ -413,7 +413,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)
@@ -626,7 +627,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;
@@ -1013,7 +1015,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