Re: [Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2008-06-15 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

2008/6/13 Marko Lindqvist:

 2007/3/18 Marko Lindqvist:

 1: Treaty: The White Horde can't have tech Asian Architecture

  Per's patch updated for S2_2.

 Committed to TRUNK (r14758) and S2_2 (r14759).

 S2_1 will wait until 2.1.5 has been released.


 - ML



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


[Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2008-06-13 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

 [EMAIL PROTECTED] - Fri Jun 13 16:46:22 2008]:
 
 2007/3/18 Marko Lindqvist:
 
  1: Treaty: The White Horde can't have tech Asian Architecture
 
  Per's patch updated for S2_2.
 
  Function to check if tech is ever available for player has been
 renamed as player_invention_is_ready() ??
  Unless someone has can tell me good reason for that, I'll rename it
 again (Old name tech_is_available() was bad, but new one is IMO even
 worse) There's buildings related function
 can_player_build_improvement_later()  With similar logic this function
 could be can_player_research_later()

How about player_tech_is_reachable(player, tech) ? Or substitute
tech for whatever is the usual name for technologies in the
code.


--
じゃ、この名前はどうですか。

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


Re: [Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2008-06-13 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

2008/6/13 Madeline Book:

 How about player_tech_is_reachable(player, tech) ? Or substitute
 tech for whatever is the usual name for technologies in the
 code.

 In other parts of the code word  reachable means that all parent
techs are known - one can start researching tech immediately.


 - ML



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


[Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2008-06-13 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

 [EMAIL PROTECTED] - Fri Jun 13 18:05:10 2008]:
 
 2008/6/13 Madeline Book:
 
  How about player_tech_is_reachable(player, tech) ? Or substitute
  tech for whatever is the usual name for technologies in the
  code.
 
  In other parts of the code word  reachable means that all parent
 techs are known - one can start researching tech immediately.

That case should be called player_can_research_tech
in my opinion (or something along the lines of
player_has_tech_prerequisites). :/


--
もう!また面倒くさいことが出される

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


[Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2007-03-27 Thread Per I. Mathisen

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

Patch. Untested. - Per
Index: ai/advdiplomacy.c
===
--- ai/advdiplomacy.c	(revision 12880)
+++ ai/advdiplomacy.c	(working copy)
@@ -125,7 +125,8 @@
 {
   int bulbs, tech_want, worth;
 
-  if (get_invention(pplayer, tech) == TECH_KNOWN) {
+  if (get_invention(pplayer, tech) == TECH_KNOWN
+  || !tech_is_available(pplayer, tech)) {
 return 0;
   }
   bulbs = total_bulbs_required_for_goal(pplayer, tech) * 3;
@@ -965,7 +966,9 @@
   bool is_dangerous;
 
   tech_type_iterate(tech) {
-if (tech == A_NONE) {
+if (tech == A_NONE 
+|| !tech_is_available(player2, tech)
+|| !tech_is_available(player1, tech)) {
   worth[tech] = 0;
   continue;
 }
@@ -1034,10 +1037,12 @@
   if (players_on_same_team(pplayer, aplayer)) {
 for (index = A_FIRST; index  game.control.num_tech_types; index++) {
   if ((get_invention(pplayer, index) != TECH_KNOWN)
-   (get_invention(aplayer, index) == TECH_KNOWN)) {
+   (get_invention(aplayer, index) == TECH_KNOWN)
+   tech_is_available(pplayer, index)) {
ai_diplomacy_suggest(aplayer, pplayer, CLAUSE_ADVANCE, index);
   } else if ((get_invention(pplayer, index) == TECH_KNOWN)
-   (get_invention(aplayer, index) != TECH_KNOWN)) {
+   (get_invention(aplayer, index) != TECH_KNOWN)
+   tech_is_available(aplayer, index)) {
 ai_diplomacy_suggest(pplayer, aplayer, CLAUSE_ADVANCE, index);
   }
 }
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2007-03-18 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

1: Treaty: The White Horde can't have tech Asian Architecture


 - ML



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


Re: [Freeciv-Dev] (PR#38372) [Bug] AI tries to trade unreachable techs

2007-03-18 Thread Peter Schaefer

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

Interesting question, there probably would be room for a flag that
allows trading techs unreachable to other nations. Dunno if it would
be used much

On 3/18/07, Marko Lindqvist [EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=38372 

 1: Treaty: The White Horde can't have tech Asian Architecture


  - ML



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




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