Difference for server/weather.c from version 1.18 to 1.19


version 1.18 version 1.19
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_weather_c =   * static char *rcsid_weather_c =
  *   "$Id: weather.c,v 1.18 2002/12/09 03:52:46 garbled Exp $";   *   "$Id: weather.c,v 1.19 2002/12/09 04:55:38 garbled Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 390
 
Line 390
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].pressure);       fscanf(fp, "%hd ", &weathermap[x][y].pressure);
      if (weathermap[x][y].pressure < 960 ||       if (weathermap[x][y].pressure < 960 ||
  weathermap[x][y].pressure > 1040)   weathermap[x][y].pressure > 1040)
  weathermap[x][y].pressure = rndm(960, 1040);   weathermap[x][y].pressure = rndm(960, 1040);
Line 474
 
Line 474
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].winddir);       fscanf(fp, "%c ", &weathermap[x][y].winddir);
      if (weathermap[x][y].winddir < 1 ||       if (weathermap[x][y].winddir < 1 ||
  weathermap[x][y].winddir > 8)   weathermap[x][y].winddir > 8)
  weathermap[x][y].winddir = rndm(1, 8);   weathermap[x][y].winddir = rndm(1, 8);
Line 524
 
Line 524
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].windspeed);       fscanf(fp, "%c ", &weathermap[x][y].windspeed);
      if (weathermap[x][y].windspeed < 0 ||       if (weathermap[x][y].windspeed < 0 ||
  weathermap[x][y].windspeed > 120)   weathermap[x][y].windspeed > 120)
  weathermap[x][y].windspeed = rndm(1, 30);   weathermap[x][y].windspeed = rndm(1, 30);
Line 751
 
Line 751
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].humid);       fscanf(fp, "%c ", &weathermap[x][y].humid);
      if (weathermap[x][y].humid < 0 ||       if (weathermap[x][y].humid < 0 ||
  weathermap[x][y].humid > 100)   weathermap[x][y].humid > 100)
  weathermap[x][y].humid = rndm(0, 100);   weathermap[x][y].humid = rndm(0, 100);
Line 847
 
Line 847
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].water);       fscanf(fp, "%c ", &weathermap[x][y].water);
      if (weathermap[x][y].water > 100)       if (weathermap[x][y].water > 100)
  weathermap[x][y].water = rndm(0, 100);   weathermap[x][y].water = rndm(0, 100);
  }   }
Line 863
 
Line 863
   
 void init_humid_elev()  void init_humid_elev()
 {  {
     int x, y, tx, ty, nx, ny, ax, ay, j, k;      int x, y, tx, ty, nx, ny, ax, ay, j;
     int spwtx, spwty, dir;      int spwtx, spwty;
     char *mapname;      char *mapname;
     long int elev;      long int elev;
     int water, space;      int water, space;
Line 1016
 
Line 1016
     }      }
     for (x=0; x < WEATHERMAPTILESX; x++) {      for (x=0; x < WEATHERMAPTILESX; x++) {
  for (y=0; y < WEATHERMAPTILESY; y++) {   for (y=0; y < WEATHERMAPTILESY; y++) {
      fscanf(fp, "%d ", &weathermap[x][y].temp);       fscanf(fp, "%hd ", &weathermap[x][y].temp);
      if (weathermap[x][y].temp < -30 ||       if (weathermap[x][y].temp < -30 ||
  weathermap[x][y].temp > 60)   weathermap[x][y].temp > 60)
  weathermap[x][y].temp = rndm(-10, 40);   weathermap[x][y].temp = rndm(-10, 40);
Line 1124
 
Line 1124
   
 void init_weather()  void init_weather()
 {  {
     int x, y, tx, ty;      int y, tx, ty;
     int i, j;  
     int water;  
     long int tmp;  
     char filename[MAX_BUF];      char filename[MAX_BUF];
     FILE *fp;      FILE *fp;
     mapstruct *m;  
   
     /* all this stuff needs to be set, otherwise this function will cause      /* all this stuff needs to be set, otherwise this function will cause
      * chaos and destruction.       * chaos and destruction.
Line 1789
 
Line 1785
      /* we look up through two tiles for a matching tile */       /* we look up through two tiles for a matching tile */
      if (weather_grow[i].tile != NULL) {       if (weather_grow[i].tile != NULL) {
  if (strcmp(GET_MAP_OB(m, x, y)->arch->name,   if (strcmp(GET_MAP_OB(m, x, y)->arch->name,
  weather_grow[i].tile) != 0)      weather_grow[i].tile) != 0) {
      if (GET_MAP_OB(m, x, y)->above != NULL) {       if (GET_MAP_OB(m, x, y)->above != NULL) {
  if (strcmp(GET_MAP_OB(m, x, y)->above->arch->name,   if (strcmp(GET_MAP_OB(m, x, y)->above->arch->name,
     weather_grow[i].tile) != 0)      weather_grow[i].tile) != 0)
Line 1797
 
Line 1793
      } else       } else
  continue;   continue;
      }       }
        }
      if ((float)weathermap[wx][wy].rainfall/days < weather_grow[i].rfmin ||       if ((float)weathermap[wx][wy].rainfall/days < weather_grow[i].rfmin ||
  (float)weathermap[wx][wy].rainfall/days > weather_grow[i].rfmax)   (float)weathermap[wx][wy].rainfall/days > weather_grow[i].rfmax)
  continue;   continue;
Line 1954
 
Line 1951
 void feather_map(mapstruct *m, int wx, int wy, char *filename)  void feather_map(mapstruct *m, int wx, int wy, char *filename)
 {  {
     int x, y, i, nx, ny, j;      int x, y, i, nx, ny, j;
     int avoid, two, temp, sky, gotsnow, found, nodstk;      int avoid, two, gotsnow, nodstk;
     object *ob, *tmp, *oldsnow, *topfloor, *ntmp, *ntopfloor;      object *ob, *tmp, *oldsnow, *topfloor, *ntmp, *ntopfloor;
     char *doublestack, *doublestack2;  
     archetype *at;      archetype *at;
   
     for (x=0; x < settings.worldmaptilesizex; x++) {      for (x=0; x < settings.worldmaptilesizex; x++) {


Legend:
line(s) removed in v.1.18 
line(s) changed
 line(s) added in v.1.19

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