Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3745) Diplomacy patch part 3
Home

[Freeciv-Dev] Re: (PR#3745) Diplomacy patch part 3

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3745) Diplomacy patch part 3
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sat, 19 Apr 2003 10:55:21 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Quoting "Per I. Mathisen" <per@xxxxxxxxxxx>:

> 
> This patch backports one new function from the AI diplomacy patch,
> player_is_dangerous(), and optimizes the generation of the data this
> function and the AI diplomacy patch uses for checking if other players are
> allied or at war with players that we are allied to or allied to a player
> that we are at war with. This new function is used in assess_danger() and
> in aidata calculations.
> 
> Please look at and commit this and part 2 as soon as possible, so that I
> can move forward on the next parts.

I am not sure why you need this for diplomacy patches (as opposed to AI 
diplomacy)?

Nitpicks:

I would rename struct ai_diplomacy to struct ai_dip_intel and other
to player_intel.

I would do just
+  return (pplayers_at_war(pplayer, aplayer)
+      || pplayer->diplstates[aplayer->player_no].has_reason_to_cancel
+      || ai->diplomacy.acceptable_reputation > aplayer->reputation
+      || adip->is_allied_with_enemy);
as opposed to if.

Otherwise the patch looks sane.

G.




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