Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2003:
[freeciv-ai] improve diplomat logging + bugfix
Home

[freeciv-ai] improve diplomat logging + bugfix

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] improve diplomat logging + bugfix
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 6 May 2003 06:00:30 +0000 (GMT)

This patch improves logging in ai/aidiplomat.c, and also solves a little
bug:

-    time_to_dest /= ut->move_rate;
     time_to_dest *= (time_to_dest/2); /* No long treks, please */

     /* Almost kill_desire */
     want = (p_success * gain - p_failure * loss) / 100
-           - SHIELD_WEIGHTING * time_to_dest;
+           - SHIELD_WEIGHTING * (time_to_dest / ut->move_rate);

If time_to_dest is == ut->move_rate, the penalty for long treks is never
applied, leading to ballooning want in this case.

Since I can't see that there can be any controversial stuff in here, I'm
committing this at once.

  - Per

Attachment: diplog1.diff
Description: Text document


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