[crossfire] Latest CVS version of java editor SERIOUSLY flawed on my system

Brendan Lally b.t.lally at warwick.ac.uk
Sun Apr 10 11:52:32 CDT 2005


On Sunday 10 Apr 2005 15:44, Andrew Fuchs wrote:
>
     
      The latest version of CFJavaEditor in CVS has destroyed 2 of my maps.
     
     >
     
      When saving maps, it  writes the file with null contents.
     
     
I have a horrible feeling that might be my fault. I don't know why though. I 
changed the writing in and out code to stop the stripping of some of the 
headers, when I tested the changes on my system it worked properly.

Can you point to a map that causes this problem (either your own or in CVS)? 
The ones I tested were ok...

I can't figure out what could cause the problem you describe. The only thing I 
can think of is that the string I am using isn't being initialised properly, 
so that some random pointer is being written in, but this shouldn't give the 
null files you describe, it should be random garbage (either that or one of 
java's ever-present exceptions). 

In the unlikely event that I am right, I /think/ the answer would look like 
this:

Index: src/cfeditor/MapArchObject.java
===================================================================
RCS file: /cvsroot/crossfire/CFJavaEditor/src/cfeditor/MapArchObject.java,v
retrieving revision 1.8
diff -C5 -r1.8 MapArchObject.java
*** src/cfeditor/MapArchObject.java     7 Apr 2005 23:06:35 -0000       1.8
--- src/cfeditor/MapArchObject.java     10 Apr 2005 16:19:10 -0000
***************
*** 87,97 ****
      private boolean ultimate_death;  // permanent death with instant 
character deletion
      private boolean pvp;             // PVP combat allowed

      private String name;             // map name (this is the name that 
appears in the game)
      private String filename;         // name of the map file
!     private String region;           // the region the map is in
      private String[] tile_path = new String[MAX_TILE];  // Used with map 
tiling.  0=north, 1=east, 2=south, 3=west

      /**
       * Constructor, set default values
       *
--- 87,97 ----
      private boolean ultimate_death;  // permanent death with instant 
character deletion
      private boolean pvp;             // PVP combat allowed

      private String name;             // map name (this is the name that 
appears in the game)
      private String filename;         // name of the map file
!     private String region = new String();                 // the region the 
map is in
      private String[] tile_path = new String[MAX_TILE];  // Used with map 
tiling.  0=north, 1=east, 2=south, 3=west

      /**
       * Constructor, set default values
       *

AFAICT this runs exactly the same as the current CVS map, but if you (or 
anyone else experiencing the same problem) can either patch and test with 
this or give/point me to a test case map where the problem you describe 
occurs, then I can determine if that is the problem and if this is the 
solution.

If anyone knows better what the problem is, then by all means, do tell.

    
    


More information about the crossfire mailing list