Author: sveinung
Date: Tue Jul 21 15:46:55 2015
New Revision: 29230

URL: http://svn.gna.org/viewcvs/freeciv?rev=29230&view=rev
Log:
Fix unit vs units action probability calculation

Fix handling of special action probability values.

See bug #23702

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=29230&r1=29229&r2=29230&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Tue Jul 21 15:46:55 2015
@@ -1427,12 +1427,14 @@
     case ACTPROB_NOT_IMPLEMENTED:
       /* Not implemented domiantes all except impossible. */
       prob_all = ACTPROB_NOT_IMPLEMENTED;
+      break;
     case ACTPROB_NOT_KNOWN:
       if (prob_all != ACTPROB_NOT_IMPLEMENTED) {
         /* Not known dominates all except not implemented and
          * impossible. */
         prob_all = ACTPROB_NOT_KNOWN;
       }
+      break;
     default:
       fc_assert_msg(prob_unit <= 200, "Invalid probability %d", prob_unit);
 
@@ -1444,6 +1446,7 @@
       /* Probability against all target units considered until this moment
        * and the probability against this target unit. */
       prob_all = (prob_all * prob_unit) / 200;
+      break;
     }
   } unit_list_iterate_end;
 


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

Reply via email to