[Freeciv-Dev] Re: [PATCH] Cleaned up more magic code in the client (PR#
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I would be happier if this also applied the iso code that is fixed
here to the original code in the next function. This would cleanup
all the magic number directions, and off map accesses and make both
sets of code virtually identical like they should be.
But this patch is fine as far as it goes.
Cheers,
RossW
=====
At 09:16 AM 01/09/09 +0200, Raimar Falke wrote:
>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
|
|