Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6402) AI focus woes.
Home

[Freeciv-Dev] Re: (PR#6402) AI focus woes.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory.Berkolaiko@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6402) AI focus woes.
From: "Arnstein Lindgard" <a-l@xxxxxxx>
Date: Fri, 14 Nov 2003 03:32:00 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Sun, 5 Oct 2003 04:47:47 -0700
"Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx> wrote:

> 2. the client observing AI should not focus on unsentried units [2].  It
> is highly annoying, I switch off all the auto-center options to observe
> one particular part of the map and the client still jumps back and forth
> when some units decide to go ashore.

If I turn off the local options, I can't really see any map jumping in
AI mode, but we can do this small fix; No focus/map jump in AI mode,
unless you turn on "auto center on units" or "auto center on combat".


Arnstein

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.336
diff -u -r1.336 packhand.c
--- client/packhand.c   2003/10/27 14:25:24     1.336
+++ client/packhand.c   2003/11/14 11:30:18
@@ -936,6 +936,7 @@
 
       /* Wakeup Focus */
       if (wakeup_focus 
+          && !game.player_ptr->ai.control
           && punit->owner == game.player_idx
           && punit->activity == ACTIVITY_SENTRY
           && packet_unit->activity == ACTIVITY_IDLE
@@ -1158,7 +1159,8 @@
   if(repaint_unit)
     refresh_tile_mapcanvas(punit->x, punit->y, FALSE);
 
-  if (check_focus || get_unit_in_focus() == NULL)
+  if ((check_focus || get_unit_in_focus() == NULL) &&
+      !game.player_ptr->ai.control)
     update_unit_focus();
   
   return ret;

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