Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] city_map_size fix and idea
Home

[Freeciv-Dev] Re: [PATCH] city_map_size fix and idea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, Jason Dorje Short <jshort@xxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] city_map_size fix and idea
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 18:43:58 -0400

I'm sure the patch will only get bigger until it is committed. There are
a lot of these sort of bugs lurking in the current codebase that need to
be fixed. 

For example here is another one to add to 06a that cored on me a day or 
so ago. It will be part of the next corecleanup_07 :-).

tilespec.c:
@@ -1530,10 +1540,15 @@
   if(ptile->known==TILE_KNOWN_FOGGED && draw_fog_of_war) *sprs++ =
sprites.tx.f
og;

   if(!citymode) {
-    tileno = INDEX_NSEW((tile_is_known(abs_x0, abs_y0-1)==TILE_UNKNOWN),
-                        (tile_is_known(abs_x0, abs_y0+1)==TILE_UNKNOWN),
-                        (tile_is_known(abs_x0+1, abs_y0)==TILE_UNKNOWN),
-                        (tile_is_known(abs_x0-1, abs_y0)==TILE_UNKNOWN));
+    tileno = INDEX_NSEW(
+      (is_real_tile(abs_x0, abs_y0-1)
+        && (tile_is_known(abs_x0, abs_y0-1)==TILE_UNKNOWN)),
+      (is_real_tile(abs_x0, abs_y0+1)
+        && (tile_is_known(abs_x0, abs_y0+1)==TILE_UNKNOWN)),
+      (is_real_tile(abs_x0+1, abs_y0)
+        && (tile_is_known(abs_x0+1, abs_y0)==TILE_UNKNOWN)),
+      (is_real_tile(abs_x0-1, abs_y0)
+        && (tile_is_known(abs_x0-1, abs_y0)==TILE_UNKNOWN)));
     if (tileno)
       *sprs++ = sprites.tx.darkness[tileno];
   }
   

Actually if you like I could send you one of these every five minutes until
you had the whole of corecleanup_06a. But it is probably more efficient to
process most of these similar things in a single pass, rather than 129 
separate 20 line emails :-).

Cheers,
RossW
=====

At 05:06 PM 01/08/22 +0200, Raimar Falke wrote:
>On Wed, Aug 22, 2001 at 09:41:36AM -0400, Ross W. Wetmore wrote:
>> This is cleaned up in corecleanup_06a which also fixes the iterate macro
>> to get rid of all the unchecked pcity accesses. However, I think I missed 
>> the savegame spot.
>> 
>> We need to get together, merge our changes and submit a joint patch, maybe.
>> Having two eyes pull out these chagnes is good, having overlapping patches
>> is probably not.
>
>Sounds like a good idea. I just hope the patch would be so big.
>
>       Raimar
>-- 
> email: rf13@xxxxxxxxxxxxxxxxx
> Q:  Do you know what the death rate around here is?
> A:  One per person.




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