[crossfire] Inconsistencies between map loading and map saving code

Mark Wedel mwedel at sonic.net
Fri Aug 26 23:49:15 CDT 2005


Andreas Kirschbaum wrote:
>
     
      There are some inconsistencies in how crossfire/crossedit and
     
     >
     
      CFJavaEditor handle the map headers "reset_timeout" and
     
     >
     
      "enter_x"/"enter_y":
     
     >
     
     
     >
     
       - CFJavaEditor uses the default value "0" for missing headers. It saves
     
     >
     
         the headers only if the current value is positive.
     
     >
     
     
     >
     
       - crossfire/crossedit use the default value "7200" (for reset_timeout)
     
     >
     
         or "1" (for enter_x and enter_y). But it saves these values only if
     
     >
     
         the current value is not "0".
     
     >
     
     
     >
     
      This behavior makes crossedit add these headers by just loading and
     
     >
     
      saving a map.
     
     >
     
     
     >
     
      I'd like to remove these inconsistencies by always using "0" as the
     
     >
     
      default value for missing headers, and saving the headers only if the
     
     >
     
      current value is positive.
     
     >
     
     
     >
     
      To not change the semantics for maps without a reset_timeout header
     
     >
     
      field, I'd change set_map_reset_time() in common/map.c to treat the
     
     >
     
      value "0" as the "default timeout value" (7200). (Note that
     
     >
     
      set_map_reset_time() is the only function accessing this field.)
     
     >
     
     
     >
     
      For the fields enter_x/enter_y I just hope that most (all?) maps will
     
     >
     
      still work: either the exit leading into this map contains coordinates,
     
     >
     
      or the server will (hopefully) place the player to 1/1 if row and column
     
     >
     
      0 are blocked.
     
     
  If the change is only made for future maps, I think that is fine.

  That is to say that if a map has enter_x as 1, and loaded in the editor and 
saved, the editor shouldn't now strip that out.

  It basically should just not modify maps that don't have that field set.

  I'd say same thing for timeout value.


    
    


More information about the crossfire mailing list