Difference for server/weather.c from version 1.36 to 1.37


version 1.36 version 1.37
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_weather_c =   * static char *rcsid_weather_c =
  *   "$Id: weather.c,v 1.36 2005/03/24 21:07:47 tchize Exp $";   *   "$Id: weather.c,v 1.37 2005/04/14 19:15:42 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 936
 
Line 936
 {  {
     int x, y, tx, ty, nx, ny, ax, ay, j;      int x, y, tx, ty, nx, ny, ax, ay, j;
     int spwtx, spwty;      int spwtx, spwty;
     char *mapname;      const char *mapname;
     long int elev;      long int elev;
     int water, space;      int water, space;
     mapstruct *m;      mapstruct *m;
Line 2281
 
Line 2281
  * value is the name of the map that corner resides in.   * value is the name of the map that corner resides in.
  */   */
   
 char *weathermap_to_worldmap_corner(int wx, int wy, int *x, int *y, int dir)  const char *weathermap_to_worldmap_corner(int wx, int wy, int *x, int *y, int dir)
 {  {
     int spwtx, spwty;      int spwtx, spwty;
     int tx, ty, nx, ny;      int tx, ty, nx, ny;
     char *mapname;   static char mapname[ MAX_BUF ];
          
     spwtx = (settings.worldmaptilesx * settings.worldmaptilesizex) / WEATHERMAPTILESX;      spwtx = (settings.worldmaptilesx * settings.worldmaptilesizex) / WEATHERMAPTILESX;
     spwty = (settings.worldmaptilesy * settings.worldmaptilesizey) / WEATHERMAPTILESY;      spwty = (settings.worldmaptilesy * settings.worldmaptilesizey) / WEATHERMAPTILESY;
Line 2306
 
Line 2306
          
     nx = (tx / settings.worldmaptilesizex) + settings.worldmapstartx;      nx = (tx / settings.worldmaptilesizex) + settings.worldmapstartx;
     ny = (ty / settings.worldmaptilesizey) + settings.worldmapstarty;      ny = (ty / settings.worldmaptilesizey) + settings.worldmapstarty;
     mapname = malloc(sizeof(char) * strlen("world/world_0000_0000"));      snprintf(mapname, MAX_BUF, "world/world_%d_%d", nx, ny);
     sprintf(mapname, "world/world_%d_%d", nx, ny);  
          
     *x = tx%settings.worldmaptilesizex;      *x = tx%settings.worldmaptilesizex;
     *y = ty%settings.worldmaptilesizey;      *y = ty%settings.worldmaptilesizey;
     return(mapname);      return mapname;
 }  }
   
 /*  /*


Legend:
line(s) removed in v.1.36 
line(s) changed
 line(s) added in v.1.37

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:53