Difference for server/weather.c from version 1.39 to 1.40


version 1.39 version 1.40
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_weather_c =   * static char *rcsid_weather_c =
  *   "$Id: weather.c,v 1.39 2005/07/16 21:10:40 akirschbaum Exp $";   *   "$Id: weather.c,v 1.40 2005/07/17 11:00:05 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 1346
 
Line 1346
  * occur.   * occur.
  */   */
   
 void weather_effect(char *filename)  void weather_effect(const char *filename)
 {  {
     mapstruct *m;      mapstruct *m;
     int wx, wy, x, y;      int wx, wy, x, y;
Line 1362
 
Line 1362
     x = 0;      x = 0;
     y = 0;      y = 0;
     /* for now, just bail if it's not the worldmap */      /* for now, just bail if it's not the worldmap */
     if (worldmap_to_weathermap(x, y, &wx, &wy, /*filename*/ m) != 0)      if (worldmap_to_weathermap(x, y, &wx, &wy, m) != 0)
  return;   return;
  /*First, calculate temperature*/   /*First, calculate temperature*/
  calculate_temperature(m, wx, wy);   calculate_temperature(m, wx, wy);
     /* we change the world first, if needed */      /* we change the world first, if needed */
     if (settings.dynamiclevel >= 5) {      if (settings.dynamiclevel >= 5) {
  change_the_world(m, wx, wy, filename);   change_the_world(m, wx, wy);
     }      }
     if (settings.dynamiclevel >= 2) {      if (settings.dynamiclevel >= 2) {
  let_it_snow(m, wx, wy, filename);   let_it_snow(m, wx, wy);
  singing_in_the_rain(m, wx, wy, filename);   singing_in_the_rain(m, wx, wy);
  }   }
     /*    if (settings.dynamiclevel >= 4) {      /*    if (settings.dynamiclevel >= 4) {
      feather_map(m, wx, wy, filename);       feather_map(m, wx, wy, filename);
      }*/       }*/
     if (settings.dynamiclevel >= 3) {      if (settings.dynamiclevel >= 3) {
  plant_a_garden(m, wx, wy, filename);   plant_a_garden(m, wx, wy);
     }      }
 }  }
   
Line 1462
 
Line 1462
  * weather_effect()   * weather_effect()
  */   */
   
 void let_it_snow(mapstruct *m, int wx, int wy, char *filename)  void let_it_snow(mapstruct *m, int wx, int wy)
 {  {
     int x, y, i;      int x, y, i;
     int nx, ny, j, d;      int nx, ny, j, d;
Line 1491
 
Line 1491
  y = ny;   y = ny;
      }       }
      /* we use the unjittered coordinates */       /* we use the unjittered coordinates */
      (void)worldmap_to_weathermap(nx, ny, &wx, &wy, /*filename*/ m);       (void)worldmap_to_weathermap(nx, ny, &wx, &wy, m);
      ob = NULL;       ob = NULL;
      at = NULL;       at = NULL;
      /* this will definately need tuning */       /* this will definately need tuning */
Line 1680
 
Line 1680
  * weather_effect()   * weather_effect()
  */   */
   
 void singing_in_the_rain(mapstruct *m, int wx, int wy, char *filename)  void singing_in_the_rain(mapstruct *m, int wx, int wy)
 {  {
     int x, y, i;      int x, y, i;
     int nx, ny, d, j;      int nx, ny, d, j;
Line 1709
 
Line 1709
  y = ny;   y = ny;
      }       }
      /* we use the unjittered coordinates */       /* we use the unjittered coordinates */
      (void)worldmap_to_weathermap(nx, ny, &wx, &wy, /*filename*/m);       (void)worldmap_to_weathermap(nx, ny, &wx, &wy, m);
      ob = NULL;       ob = NULL;
      at = NULL;       at = NULL;
      avoid = 0;       avoid = 0;
Line 1900
 
Line 1900
  * weather_effect()   * weather_effect()
  */   */
   
 void plant_a_garden(mapstruct *m, int wx, int wy, char *filename)  void plant_a_garden(mapstruct *m, int wx, int wy)
 {  {
     int x, y, i;      int x, y, i;
     int avoid, two, temp, sky, gotsnow, found, days;      int avoid, two, temp, sky, gotsnow, found, days;
Line 1910
 
Line 1910
     days = todtick / HOURS_PER_DAY;      days = todtick / HOURS_PER_DAY;
     for (x=0; x < settings.worldmaptilesizex; x++) {      for (x=0; x < settings.worldmaptilesizex; x++) {
  for (y=0; y < settings.worldmaptilesizey; y++) {   for (y=0; y < settings.worldmaptilesizey; y++) {
      (void)worldmap_to_weathermap(x, y, &wx, &wy, /*filename*/m);       (void)worldmap_to_weathermap(x, y, &wx, &wy, m);
      ob = NULL;       ob = NULL;
      at = NULL;       at = NULL;
      avoid = 0;       avoid = 0;
Line 1996
 
Line 1996
  * Process worldmap regrowth.  m is the map we are currently processing.   * Process worldmap regrowth.  m is the map we are currently processing.
  * wx and wy are   * wx and wy are
  * the weathermap coordinates for the weathermap square we want to work on.   * the weathermap coordinates for the weathermap square we want to work on.
  * filename is the pathname for the current map.  This should be called from   * This should be called from weather_effect()
  * weather_effect()  
  */   */
   
 void change_the_world(mapstruct *m, int wx, int wy, char *filename)  void change_the_world(mapstruct *m, int wx, int wy)
 {  {
     int x, y, i;      int x, y, i;
     int nx, ny, j, d;      int nx, ny, j, d;
Line 2029
 
Line 2028
  y = ny;   y = ny;
      }       }
      /* we use the unjittered coordinates */       /* we use the unjittered coordinates */
      (void)worldmap_to_weathermap(nx, ny, &wx, &wy, /*filename*/m);       (void)worldmap_to_weathermap(nx, ny, &wx, &wy, m);
      ob = NULL;       ob = NULL;
      at = NULL;       at = NULL;
      dat = NULL;       dat = NULL;
Line 2133
 
Line 2132
  * Reduce the blockiness of the maps. m is the map we are currently processing.   * Reduce the blockiness of the maps. m is the map we are currently processing.
  * wx and wy are   * wx and wy are
  * the weathermap coordinates for the weathermap square we want to work on.   * the weathermap coordinates for the weathermap square we want to work on.
  * filename is the pathname for the current map.  This should be called from   * This should be called from weather_effect()
  * weather_effect()  
  */   */
   
 void feather_map(mapstruct *m, int wx, int wy, char *filename)  void feather_map(mapstruct *m, int wx, int wy)
 {  {
     int x, y, i, nx, ny, j;      int x, y, i, nx, ny, j;
     int avoid, two, gotsnow, nodstk;      int avoid, two, gotsnow, nodstk;
Line 2146
 
Line 2144
   
     for (x=0; x < settings.worldmaptilesizex; x++) {      for (x=0; x < settings.worldmaptilesizex; x++) {
  for (y=0; y < settings.worldmaptilesizey; y++) {   for (y=0; y < settings.worldmaptilesizey; y++) {
      (void)worldmap_to_weathermap(x, y, &wx, &wy, /*filename*/m);       (void)worldmap_to_weathermap(x, y, &wx, &wy, m);
      ob = NULL;       ob = NULL;
      at = NULL;       at = NULL;
      avoid = 0;       avoid = 0;
Line 2233
 
Line 2231
    map.  returns -1 if you give it something it can't figure out. 0 normally.     map.  returns -1 if you give it something it can't figure out. 0 normally.
 */  */
   
 /*int worldmap_to_weathermap(int x, int y, int *wx, int *wy, char *filename)*/  
 int worldmap_to_weathermap(int x, int y, int *wx, int *wy, mapstruct* m)  int worldmap_to_weathermap(int x, int y, int *wx, int *wy, mapstruct* m)
 {  {
     int spwtx, spwty;      int spwtx, spwty;


Legend:
line(s) removed in v.1.39 
line(s) changed
 line(s) added in v.1.40

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