Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2004:
[freeciv-ai] (PR#9812) AI.love lacks specification
Home

[freeciv-ai] (PR#9812) AI.love lacks specification

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#9812) AI.love lacks specification
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sat, 28 Aug 2004 01:58:25 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9812 >

> [mstefek - Wed Aug 25 19:20:48 2004]:
> 
> AI.love should mean some absolute value in some well defined unit.
> Because:
> - It's saved in savegame
> - It is used by client
> - We want to understand it
> 
> --
> mateusz
> 
I think we can agree on a range [-100..100].
--
mateusz
Index: advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.27
diff -u -r1.27 advdiplomacy.c
--- advdiplomacy.c      30 Jul 2004 20:40:49 -0000      1.27
+++ advdiplomacy.c      28 Aug 2004 08:57:29 -0000
@@ -711,6 +711,10 @@
      * Gravitate towards zero. */
     pplayer->ai.love[aplayer->player_no] -= 
        (pplayer->ai.love[aplayer->player_no] * ai->diplomacy.love_coeff / 100);
+       
+    /* ai love should always be in range [-100..100] */
+    pplayer->ai.love[aplayer->player_no] = 
+      MAX(-100, MIN(100, pplayer->ai.love[aplayer->player_no]));
   } players_iterate_end;
 
   /* Stop war against a dead player */

[Prev in Thread] Current Thread [Next in Thread]