<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39767 >

> [pepeto - Thu Oct 11 13:59:25 2007]:
> 
> 2- Bribing units on sea is a feature, then pf code should allow it.
> 


Index: common/aicore/pf_tools.c
===================================================================
--- common/aicore/pf_tools.c	(révision 14852)
+++ common/aicore/pf_tools.c	(copie de travail)
@@ -161,7 +161,10 @@
   int move_cost;
 
   if (!is_native_tile_to_class(param->uclass, ptile1)) {
-    if (unit_class_transporter_capacity(ptile1, param->owner, param->uclass) > 0) {
+    if (unit_class_transporter_capacity(ptile1, param->owner, param->uclass) > 0
+	|| (!is_ocean(ptile->terrain)
+	    && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(ptile1->units) == 1)) {
       move_cost = SINGLE_MOVE;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
@@ -301,7 +304,10 @@
   int move_cost;
 
   if (!is_native_tile_to_class(param->uclass, ptile1)) {
-    if (unit_class_transporter_capacity(ptile1, param->owner, param->uclass) > 0) {
+    if (unit_class_transporter_capacity(ptile1, param->owner, param->uclass) > 0
+	|| (!is_ocean(ptile->terrain)
+	    && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(ptile1->units) == 1)) {
       move_cost = MOVE_COST_ROAD;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
Index: common/aicore/pf_tools.c
===================================================================
--- common/aicore/pf_tools.c	(révision 14865)
+++ common/aicore/pf_tools.c	(copie de travail)
@@ -128,7 +128,10 @@
   int move_cost;
 
   if (is_ocean(terrain1)) {
-    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0) {
+    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0
+        || (!is_ocean(ptile->terrain)
+            && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(ptile1->units) == 1)) {
       move_cost = SINGLE_MOVE;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
@@ -274,7 +277,10 @@
   int move_cost;
 
   if (is_ocean(ptile1->terrain)) {
-    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0) {
+    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0
+        || (!is_ocean(ptile->terrain)
+            && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(ptile1->units) == 1)) {
       move_cost = MOVE_COST_ROAD;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
Index: common/aicore/pf_tools.c
===================================================================
--- common/aicore/pf_tools.c	(révision 14865)
+++ common/aicore/pf_tools.c	(copie de travail)
@@ -128,7 +128,11 @@
   int move_cost;
 
   if (is_ocean(terrain1)) {
-    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0) {
+    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0
+	|| (BV_ISSET(param->unit_flags, F_DIPLOMAT)
+	    && !is_ocean(ptile->terrain)
+            && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(&ptile1->units) == 1)) {
       move_cost = SINGLE_MOVE;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
@@ -275,7 +279,11 @@
   int move_cost;
 
   if (is_ocean(ptile1->terrain)) {
-    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0) {
+    if (ground_unit_transporter_capacity(ptile1, param->owner) > 0
+	|| (BV_ISSET(param->unit_flags, F_DIPLOMAT)
+	    && !is_ocean(ptile->terrain)
+            && is_non_allied_unit_tile(ptile1, param->owner)
+            && unit_list_size(&ptile1->units) == 1)) {
       move_cost = MOVE_COST_ROAD;
     } else {
       move_cost = PF_IMPOSSIBLE_MC;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to