[Freeciv-commits] r33665 - in /trunk: ./ common/ data/alien/ data/civ1/ data/civ2/ data/civ2civ3/ data/classic/ data/experimental/ data/multip...

2016-08-21 Thread sveinung84
Author: sveinung
Date: Sun Aug 21 12:11:55 2016
New Revision: 33665

URL: http://svn.gna.org/viewcvs/freeciv?rev=33665=rev
Log:
Support unlimited action max distance.

Allow a ruleset to specify that the entire map is a valid target of an
action rather than having to define a max_distance value large enough to
cover the biggest possible maps. This way the action will be able to cover
the entire map after the next time the map size increases.

Unlimited max distance is represented by the string "unlimited" in the
ruleset format and by the new special value ACTION_DISTANCE_UNLIMITED
internally.

See patch #7635

Modified:
trunk/common/actions.c
trunk/common/actions.h
trunk/common/game.h
trunk/data/alien/game.ruleset
trunk/data/civ1/game.ruleset
trunk/data/civ2/game.ruleset
trunk/data/civ2civ3/game.ruleset
trunk/data/classic/game.ruleset
trunk/data/experimental/game.ruleset
trunk/data/multiplayer/game.ruleset
trunk/data/sandbox/game.ruleset
trunk/data/stub/game.ruleset
trunk/data/webperimental/game.ruleset
trunk/fc_version
trunk/server/rssanity.c
trunk/server/ruleset.c
trunk/tools/ruleutil/rulesave.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=33665=33664=33665=diff
==
--- trunk/common/actions.c  (original)
+++ trunk/common/actions.c  Sun Aug 21 12:11:55 2016
@@ -227,11 +227,11 @@
   actions[ACTION_PARADROP] =
   action_new(ACTION_PARADROP, ATK_TILE,
  FALSE, FALSE, TRUE,
- 1, MAP_DISTANCE_MAX);
+ 1, ACTION_DISTANCE_MAX);
   actions[ACTION_AIRLIFT] =
   action_new(ACTION_AIRLIFT, ATK_CITY,
  FALSE, FALSE, TRUE,
- 1, MAP_DISTANCE_MAX);
+ 1, ACTION_DISTANCE_MAX);
   actions[ACTION_ATTACK] =
   action_new(ACTION_ATTACK,
  /* FIXME: Target is actually City and, depending on the
@@ -475,7 +475,8 @@
   fc_assert_ret_val(action, FALSE);
 
   return (distance >= action->min_distance
-  && distance <= action->max_distance);
+  && (distance <= action->max_distance
+  || action->max_distance == ACTION_DISTANCE_UNLIMITED));
 }
 
 /**

Modified: trunk/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=33665=33664=33665=diff
==
--- trunk/common/actions.h  (original)
+++ trunk/common/actions.h  Sun Aug 21 12:11:55 2016
@@ -131,6 +131,11 @@
 #define SPECENUM_COUNT ACT_REQ_COUNT
 #include "specenum_gen.h"
 
+/* No action max distance to target limit. */
+#define ACTION_DISTANCE_UNLIMITED (MAP_DISTANCE_MAX + 1)
+/* No action max distance can be bigger than this. */
+#define ACTION_DISTANCE_MAX ACTION_DISTANCE_UNLIMITED
+
 struct action
 {
   enum gen_action id;

Modified: trunk/common/game.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/game.h?rev=33665=33664=33665=diff
==
--- trunk/common/game.h (original)
+++ trunk/common/game.h Sun Aug 21 12:11:55 2016
@@ -797,6 +797,8 @@
 #define RS_DEFAULT_POISON_EMPTIES_FOOD_STOCK FALSE
 #define RS_DEFAULT_BOMBARD_MAX_RANGE 1
 
+#define RS_ACTION_NO_MAX_DISTANCE"unlimited"
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=33665=33664=33665=diff
==
--- trunk/data/alien/game.ruleset   (original)
+++ trunk/data/alien/game.ruleset   Sun Aug 21 12:11:55 2016
@@ -215,7 +215,11 @@
 ; will empty the food stock.
 poison_empties_food_stock = FALSE
 
-; How far away targets of "Bombard" is allowed to be.
+; The maximum distance from the actor unit to the target of the "Bombard"
+; action. The value 1 means that the targets must be on a tile adjacent to
+; the actor unit. The special value "unlimited" lifts the maximum distance
+; restriction. The maximum distance can't be smaller than the minimum
+; distance.
 bombard_max_range = 1
 
 ; What each action should be called when showing them to the player.

Modified: trunk/data/civ1/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/game.ruleset?rev=33665=33664=33665=diff
==
--- trunk/data/civ1/game.ruleset(original)
+++ trunk/data/civ1/game.rulesetSun Aug 21 12:11:55 2016
@@ -190,7 +190,11 @@
 ; will empty the food stock.
 poison_empties_food_stock = FALSE
 
-; How far away targets of "Bombard" is allowed to be.
+; The maximum distance from the actor unit to the target of the "Bombard"
+; 

[Freeciv-commits] r33660 - /branches/S2_5/server/cityturn.c

2016-08-21 Thread cazfi74
Author: cazfi
Date: Sun Aug 21 09:05:35 2016
New Revision: 33660

URL: http://svn.gna.org/viewcvs/freeciv?rev=33660=rev
Log:
Removed city_change_size() assert causing compiler warning.

See patch #7634

Modified:
branches/S2_5/server/cityturn.c

Modified: branches/S2_5/server/cityturn.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/cityturn.c?rev=33660=33659=33660=diff
==
--- branches/S2_5/server/cityturn.c (original)
+++ branches/S2_5/server/cityturn.c Sun Aug 21 09:05:35 2016
@@ -890,8 +890,6 @@
 bool city_change_size(struct city *pcity, citizens size,
   struct player *nationality)
 {
-  fc_assert_ret_val(size <= MAX_CITY_SIZE, TRUE);
-
   if (size > city_size_get(pcity)) {
 /* Increase city size until size reached, or increase fails */
 while (size > city_size_get(pcity)


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


[Freeciv-commits] r33659 - /branches/S2_6/server/cityturn.c

2016-08-21 Thread cazfi74
Author: cazfi
Date: Sun Aug 21 09:05:29 2016
New Revision: 33659

URL: http://svn.gna.org/viewcvs/freeciv?rev=33659=rev
Log:
Removed city_change_size() assert causing compiler warning.

See patch #7634

Modified:
branches/S2_6/server/cityturn.c

Modified: branches/S2_6/server/cityturn.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/cityturn.c?rev=33659=33658=33659=diff
==
--- branches/S2_6/server/cityturn.c (original)
+++ branches/S2_6/server/cityturn.c Sun Aug 21 09:05:29 2016
@@ -914,8 +914,6 @@
   struct player *nationality, const char *reason)
 {
   int change = size - city_size_get(pcity);
-
-  fc_assert_ret_val(size <= MAX_CITY_SIZE, TRUE);
 
   if (change != 0 && reason != NULL) {
 script_server_signal_emit("city_size_change", 3,


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


[Freeciv-commits] r33662 - in /branches/S2_6/data/themes: gui-gtk-2.0/Freeciv/gtk-2.0/bg.png gui-gtk-3.0/Freeciv/gtk-3.0/bg.png

2016-08-21 Thread cazfi74
Author: cazfi
Date: Sun Aug 21 09:16:47 2016
New Revision: 33662

URL: http://svn.gna.org/viewcvs/freeciv?rev=33662=rev
Log:
Improved compressions of bg.png

Patch by Frank 

See patch #7630

Modified:
branches/S2_6/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png
branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png

Modified: branches/S2_6/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png?rev=33662=33661=33662=diff
==
Binary files - no diff available.

Modified: branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png?rev=33662=33661=33662=diff
==
Binary files - no diff available.


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


[Freeciv-commits] r33661 - in /trunk/data/themes: gui-gtk-2.0/Freeciv/gtk-2.0/ gui-gtk-3.0/Freeciv/gtk-3.0/ gui-gtk-3.x/Freeciv/gtk-3.0/

2016-08-21 Thread cazfi74
Author: cazfi
Date: Sun Aug 21 09:16:42 2016
New Revision: 33661

URL: http://svn.gna.org/viewcvs/freeciv?rev=33661=rev
Log:
Improved compressions of bg.png

Patch by Frank 

See patch #7630

Modified:
trunk/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png
trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png
trunk/data/themes/gui-gtk-3.x/Freeciv/gtk-3.0/bg.png

Modified: trunk/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-gtk-2.0/Freeciv/gtk-2.0/bg.png?rev=33661=33660=33661=diff
==
Binary files - no diff available.

Modified: trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/bg.png?rev=33661=33660=33661=diff
==
Binary files - no diff available.

Modified: trunk/data/themes/gui-gtk-3.x/Freeciv/gtk-3.0/bg.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-gtk-3.x/Freeciv/gtk-3.0/bg.png?rev=33661=33660=33661=diff
==
Binary files - no diff available.


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


[Freeciv-commits] r33663 - in /trunk: common/actions.c common/map.h server/rssanity.c

2016-08-21 Thread sveinung84
Author: sveinung
Date: Sun Aug 21 11:57:25 2016
New Revision: 33663

URL: http://svn.gna.org/viewcvs/freeciv?rev=33663=rev
Log:
Fix airlifting over huge distances legality.

Airlifting from any city to any city should be allowed according to the old
rules. When "Airlift Unit" became action enabler controlled it got
MAP_MAX_LINEAR_SIZE as its maximum distance. It was assumed to cover the
whole map. The assumption was wrong. A map can be non wrapping. It can also
forbid some diagonal movement.

See bug #24997

Modified:
trunk/common/actions.c
trunk/common/map.h
trunk/server/rssanity.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=33663=33662=33663=diff
==
--- trunk/common/actions.c  (original)
+++ trunk/common/actions.c  Sun Aug 21 11:57:25 2016
@@ -231,7 +231,7 @@
   actions[ACTION_AIRLIFT] =
   action_new(ACTION_AIRLIFT, ATK_CITY,
  FALSE, FALSE, TRUE,
- 1, MAP_MAX_LINEAR_SIZE);
+ 1, MAP_DISTANCE_MAX);
   actions[ACTION_ATTACK] =
   action_new(ACTION_ATTACK,
  /* FIXME: Target is actually City and, depending on the

Modified: trunk/common/map.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/map.h?rev=33663=33662=33663=diff
==
--- trunk/common/map.h  (original)
+++ trunk/common/map.h  Sun Aug 21 11:57:25 2016
@@ -591,6 +591,11 @@
 #define MAP_MAX_LINEAR_SIZE  (MAP_MAX_SIZE * 1000 / MAP_MIN_LINEAR_SIZE)
 #define MAP_MIN_LINEAR_SIZE  16
 
+/* The distance between two points at a map shouldn't be larger than this.
+Adds MAP_MIN_LINEAR_SIZE because hex topologies forbids certain diagonal
+moves. Includes MAP_MAX_LINEAR_SIZE because a map can be non wrapping. */
+#define MAP_DISTANCE_MAX (MAP_MAX_LINEAR_SIZE + MAP_MIN_LINEAR_SIZE)
+
 #define MAP_ORIGINAL_TOPOTF_WRAPX
 #ifdef FREECIV_WEB
 /* Freeciv-web doesn't support isometric maps yet. */

Modified: trunk/server/rssanity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.c?rev=33663=33662=33663=diff
==
--- trunk/server/rssanity.c (original)
+++ trunk/server/rssanity.c Sun Aug 21 11:57:25 2016
@@ -908,7 +908,7 @@
   ok = FALSE;
 }
 
-if (paction->max_distance > MAP_MAX_LINEAR_SIZE) {
+if (paction->max_distance > MAP_DISTANCE_MAX) {
   ruleset_error(LOG_ERROR, "Action %s: max distance is %d. "
 "A map can't be that big.",
 action_get_rule_name(act), paction->max_distance);


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


[Freeciv-commits] r33664 - /trunk/common/actions.c

2016-08-21 Thread sveinung84
Author: sveinung
Date: Sun Aug 21 11:58:07 2016
New Revision: 33664

URL: http://svn.gna.org/viewcvs/freeciv?rev=33664=rev
Log:
Fix action distance validation in Freeciv-web.

The "Paradrop Unit" action limits its distance to target tile via each unit
type's field paratroopers_range. The maximum distance of the "Paradrop Unit"
action was therefore set to the UNIT_MAX_PARADROP_RANGE, the highest value
the paratroopers_range field can have. UNIT_MAX_PARADROP_RANGE comes from
paratroopers_range being transferred as an unit16 in the network protocol.

Freeciv-web builds have different max map size constants. This influences
the maximum legal action max_distance so UNIT_MAX_PARADROP_RANGE becomes too
large.

(This limits what rulesets a Freeciv-web build can load. Maybe we should
find another way to limit the map size on http://play.freeciv.org? A general
"the server operator forbids the following server settings" system could
also be used by regular public Freeciv server operators.)

Set max distance for ACTION_PARADROP to the highest value it can have. The
unit type's paratroopers_range will still limit it.

See bug #24987

Modified:
trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=33664=33663=33664=diff
==
--- trunk/common/actions.c  (original)
+++ trunk/common/actions.c  Sun Aug 21 11:58:07 2016
@@ -227,7 +227,7 @@
   actions[ACTION_PARADROP] =
   action_new(ACTION_PARADROP, ATK_TILE,
  FALSE, FALSE, TRUE,
- 1, UNIT_MAX_PARADROP_RANGE);
+ 1, MAP_DISTANCE_MAX);
   actions[ACTION_AIRLIFT] =
   action_new(ACTION_AIRLIFT, ATK_CITY,
  FALSE, FALSE, TRUE,


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