Update of bug #19429 (project freeciv):

                Category:                    None => general                
                  Status:               Confirmed => Ready For Test         
             Assigned to:                    None => pepeto                 
         Planned Release:                         => 2.4.4, 2.5.0, 2.6.0    

    _______________________________________________________

Follow-up Comment #6:

> Cause is fairly clear: MAP_MAX_LINEAR_SIZE (=512 on S2_3) is in
> native coordinates, whereas MAP_WIDTH/MAP_HEIGHT are (I think)
> map coordinates

Right!

> The obvious fix is to check NATIVE_WIDTH/HEIGHT instead (and
> possibly rename MAP_MAX_LINEAR_SIZE). But I haven't checked if
> those assertions are guarding something specific nearby that
> relies on them.
>
> Those assertions have existed since at least r7960 in 2004. I
> haven't checked if the definitions of the terms changed at some
> point.

Actually, the implementation of NATIVE_WIDTH/HEIGHT was useful in the past,
because tiles where located through the network by a pair of coordinates. So x
and y were disallowed to become bigger that what could be sent to the
network.

Nowadays, tiles are encoded in packets fields by index. So this limit is
totally outdated.

In attached patch:
* MAP_MIN_LINEAR_SIZE is now clearly a _native_ limit (like it was used
anyway);
* removed MAP_WIDTH and MAP_HEIGHT;
* map_init_topology() don't set sizes anymore (it's already done by loading
settings or by map generator initialization);
* added checks.
(minimal version for S2_4)


(file #22182, file #22183, file #22184)
    _______________________________________________________

Additional Item Attachment:

File name: trunk_map_init_topology.patch  Size:6 KB
File name: S2_5_map_init_topology.patch   Size:6 KB
File name: S2_4_map_init_topology.patch   Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?19429>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to