Author: sveinung
Date: Wed Jun 29 07:44:45 2016
New Revision: 33101

URL: http://svn.gna.org/viewcvs/freeciv?rev=33101&view=rev
Log:
Explicit action_probability variable type.

Some action probability variables are declared as int. Fix their type.

See patch #7336

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=33101&r1=33100&r2=33101&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Wed Jun 29 07:44:45 2016
@@ -2247,7 +2247,7 @@
             const struct specialist *target_specialist)
 {
   int known;
-  int chance;
+  action_probability chance;
 
   const struct unit_type *actor_unittype;
   const struct unit_type *target_unittype;
@@ -2548,7 +2548,7 @@
                                         const int action_id,
                                         const struct tile* target_tile)
 {
-  int prob_all;
+  action_probability prob_all;
   struct tile *actor_tile = unit_tile(actor_unit);
 
   if (actor_unit == NULL || target_tile == NULL
@@ -2580,16 +2580,18 @@
 
   prob_all = 200;
   unit_list_iterate(target_tile->units, target_unit) {
-    int prob_unit = action_prob(action_id,
-                                unit_owner(actor_unit),
-                                tile_city(actor_tile),
-                                NULL, actor_tile, actor_unit, NULL,
-                                NULL, NULL,
-                                unit_owner(target_unit),
-                                tile_city(unit_tile(target_unit)), NULL,
-                                unit_tile(target_unit),
-                                target_unit, NULL,
-                                NULL, NULL);
+    action_probability prob_unit;
+
+    prob_unit = action_prob(action_id,
+                            unit_owner(actor_unit),
+                            tile_city(actor_tile),
+                            NULL, actor_tile, actor_unit, NULL,
+                            NULL, NULL,
+                            unit_owner(target_unit),
+                            tile_city(unit_tile(target_unit)), NULL,
+                            unit_tile(target_unit),
+                            target_unit, NULL,
+                            NULL, NULL);
 
     if (!action_prob_possible(prob_unit)) {
       /* One unit makes it impossible for all units. */


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

Reply via email to