Difference for server/weather.c from version 1.46 to 1.47


version 1.46 version 1.47
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_weather_c =   * static char *rcsid_weather_c =
  *   "$Id: weather.c,v 1.46 2006/06/05 06:28:57 mwedel Exp $";   *   "$Id: weather.c,v 1.47 2006/08/26 16:09:13 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 1447
 
Line 1447
 {  {
     int avoid, gotsnow, i, n;      int avoid, gotsnow, i, n;
   
     object *tmp;      object *tmp, *snow;
     avoid = 0;      avoid = 0;
     gotsnow = 0;      gotsnow = 0;
     if (grow) {      if (grow) {
  for (tmp=GET_MAP_OB(m, x, y), n=0; tmp; tmp = tmp->above, n++) {          for (tmp=GET_MAP_OB(m, x, y); tmp; tmp = tmp->above) {
      /* look for things like walls, holes, etc */       /* look for things like walls, holes, etc */
      if (n)  
  if (!QUERY_FLAG (tmp, FLAG_IS_FLOOR) &&   if (!QUERY_FLAG (tmp, FLAG_IS_FLOOR) &&
      !(tmp->material & M_ICE || tmp->material & M_LIQUID))                   !(tmp->material & M_ICE || tmp->material & M_LIQUID)) {
      gotsnow++;       gotsnow++;
                   snow = tmp;
               }
      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 (tmp->arch== growth_avoids[i].what) {   if (tmp->arch== growth_avoids[i].what) {
      avoid++;       avoid++;
      break;       break;
Line 1468
 
Line 1468
      avoid++;       avoid++;
      break;       break;
  }   }
      if (avoid)              if (avoid && gotsnow)
  break;   break;
  }   }
     } else {      } else {
Line 1476
 
Line 1476
      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++;
      else                          snow = tmp;
                       } else {
  avoid++;   avoid++;
                       }
      break;       break;
  }   }
      }       }
      if (avoid || gotsnow)              if (avoid && gotsnow)
  break;   break;
  }   }
     }      }
     *gs = gotsnow;      *gs = gotsnow;
     *av = avoid;      *av = avoid;
     return tmp;  
       return snow;
 }  }
   
 /* Temperature is used in a lot of weather function.  /* Temperature is used in a lot of weather function.


Legend:
line(s) removed in v.1.46 
line(s) changed
 line(s) added in v.1.47

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