Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [PATCH] Cleaned up more magic code in the client (PR#9
Home

[Freeciv-Dev] Re: [PATCH] Cleaned up more magic code in the client (PR#9

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Cleaned up more magic code in the client (PR#945)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Sep 2001 09:16:25 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Sep 08, 2001 at 09:26:57PM -0700, Jason Dorje Short wrote:
> This patch cleans up all remaining magic directional-system code that I
> know of.
> 
> - There's an easy fix to get_drawn().  Much cleaner.  (Actually, this
> should have been included in the PR#944 patch.)
> 
> - To clean up the magic numbers that are used with DIR_D[XY]2, I removed
> the use of DIR_D[XY]2 entirely.  This may seem like a step back, but if
> the plan is to put all schema-dependent code into map.[ch] and then
> convert all at once to the new system, this is the way to go.
> 
> I've kept this separate from the PR#944 patch because this is
> controversial.
> 
> jason
> Index: client/goto.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v
> retrieving revision 1.20
> diff -u -r1.20 goto.c
> --- client/goto.c     2001/08/30 10:44:16     1.20
> +++ client/goto.c     2001/09/09 04:20:47
> @@ -671,8 +671,7 @@
>  ***********************************************************************/
>  int get_drawn(int x, int y, int dir)
>  {
> -  if ((y == 0 && dir <= 2)
> -      || (y == map.ysize-1 && dir >= 5))
> +  if (!is_real_tile(x + DIR_DX[dir], y + DIR_DY[dir]))
>      return 0;
>  
>    return *get_drawn_char(x, y, dir);
> Index: client/tilespec.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
> retrieving revision 1.49
> diff -u -r1.49 tilespec.c
> --- client/tilespec.c 2001/08/24 08:22:01     1.49
> +++ client/tilespec.c 2001/09/09 04:20:50

Exactly what I was hoping for. This should be applied. Ross?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Tank: So what do you need? Besides a miracle.
  Neo: Guns. Lots of guns.
    -- From The Matrix


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