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


version 1.37 version 1.38
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_weather_c =   * static char *rcsid_weather_c =
  *   "$Id: weather.c,v 1.37 2005/04/14 19:15:42 ryo_saeba Exp $";   *   "$Id: weather.c,v 1.38 2005/05/07 11:51:20 tchize Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 1409
 
Line 1409
      !(tmp->material & M_ICE || tmp->material & M_LIQUID))       !(tmp->material & M_ICE || tmp->material & M_LIQUID))
      gotsnow++;       gotsnow++;
      for (i=0; growth_avoids[i].name != NULL; i++) {       for (i=0; growth_avoids[i].name != NULL; i++) {
  //if (!strcmp(tmp->arch->name, growth_avoids[i].name)) {   /*if (!strcmp(tmp->arch->name, growth_avoids[i].name)) {*/
  if (tmp->arch== growth_avoids[i].what) {   if (tmp->arch== growth_avoids[i].what) {
      avoid++;       avoid++;
      break;       break;
Line 1425
 
Line 1425
     } else {      } else {
  for (tmp=GET_MAP_OB(m, x, y); tmp; tmp = tmp->above) {   for (tmp=GET_MAP_OB(m, x, y); tmp; tmp = tmp->above) {
      for (i=0; weather_avoids[i].name != NULL; i++) {       for (i=0; weather_avoids[i].name != NULL; i++) {
  //if (!strcmp(tmp->arch->name, weather_avoids[i].name)) {   /*if (!strcmp(tmp->arch->name, weather_avoids[i].name)) {*/
  if (tmp->arch == weather_avoids[i].what) {   if (tmp->arch == weather_avoids[i].what) {
      if (weather_avoids[i].snow == 1)       if (weather_avoids[i].snow == 1)
  gotsnow++;   gotsnow++;
Line 1499
 
Line 1499
      two = 0;       two = 0;
      gotsnow = 0;       gotsnow = 0;
      nodstk = 0;       nodstk = 0;
      //temp = real_world_temperature(x, y, m);       /*temp = real_world_temperature(x, y, m);*/
  temp = weathermap[wx][wy].realtemp;   temp = weathermap[wx][wy].realtemp;
      sky = weathermap[wx][wy].sky;       sky = weathermap[wx][wy].sky;
      if (temp <= 0 && sky > SKY_OVERCAST && sky < SKY_FOG)       if (temp <= 0 && sky > SKY_OVERCAST && sky < SKY_FOG)
Line 1716
 
Line 1716
      two = 0;       two = 0;
      gotsnow = 0;       gotsnow = 0;
      nodstk = 0;       nodstk = 0;
      //temp = real_world_temperature(x, y, m);       /*temp = real_world_temperature(x, y, m);*/
  temp = weathermap[wx][wy].realtemp;   temp = weathermap[wx][wy].realtemp;
      sky = weathermap[wx][wy].sky;       sky = weathermap[wx][wy].sky;
      /* it's probably allready snowing */       /* it's probably allready snowing */
Line 1916
 
Line 1916
      avoid = 0;       avoid = 0;
      two = 0;       two = 0;
      gotsnow = 0;       gotsnow = 0;
      //temp = real_world_temperature(x, y, m);       /*temp = real_world_temperature(x, y, m);*/
  temp = weathermap[wx][wy].realtemp;   temp = weathermap[wx][wy].realtemp;
      sky = weathermap[wx][wy].sky;       sky = weathermap[wx][wy].sky;
      (void)avoid_weather(&avoid, m, x, y, &gotsnow, 1);       (void)avoid_weather(&avoid, m, x, y, &gotsnow, 1);
Line 2036
 
Line 2036
      avoid = 0;       avoid = 0;
      two = 0;       two = 0;
      gotsnow = 0;       gotsnow = 0;
      //temp = real_world_temperature(x, y, m);       /*temp = real_world_temperature(x, y, m);*/
  temp = weathermap[wx][wy].realtemp;   temp = weathermap[wx][wy].realtemp;
      sky = weathermap[wx][wy].sky;       sky = weathermap[wx][wy].sky;
      (void)avoid_weather(&avoid, m, x, y, &gotsnow, 1);       (void)avoid_weather(&avoid, m, x, y, &gotsnow, 1);
Line 2233
 
Line 2233
    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, 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;
Line 2464
 
Line 2464
 {  {
     int wx, wy, temp, eleva, elevb;      int wx, wy, temp, eleva, elevb;
     object *op;      object *op;
  //printf ("real_world_temperature: worldmaptoweathermap : %s\n",m->path);   /*printf ("real_world_temperature: worldmaptoweathermap : %s\n",m->path);*/
     worldmap_to_weathermap(x, y, &wx, &wy, /*m->path*/m);      worldmap_to_weathermap(x, y, &wx, &wy, /*m->path*/m);
     temp = real_temperature(wx, wy);      temp = real_temperature(wx, wy);
     if (weathermap[wx][wy].avgelev < 0)      if (weathermap[wx][wy].avgelev < 0)
Line 2976
 
Line 2976
  pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + BLUE)]  = speed;   pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + BLUE)]  = speed;
      } else {       } else {
  speed = (speed - realmaxwind) * realscalewind;   speed = (speed - realmaxwind) * realscalewind;
 // if (speed < 100)  /* if (speed < 100)*/
 //     speed = 100;  /*     speed = 100;*/
  pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + RED)]   = speed;   pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + RED)]   = speed;
  pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + GREEN)] = 0;   pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + GREEN)] = 0;
  pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + BLUE)]  = 0;   pixels[3 * x + (1 * WEATHERMAPTILESX * 3 + BLUE)]  = 0;


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

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