DIFF formula in weather.c how it work?

From: Brian Jones (balif@nacs.net)
Date: 02/08/96

	I traced weather.c and looked at the structures and I finaly 
figured out how the structure method works.. with defining them and 
extern'ing them when needed.. woo! but I have a problem with something

  int diff, change; 
  if ((time_info.month >= 9) && (time_info.month <= 16))
    diff = (weather_info.pressure > 985 ? -2 : 2); 
    diff = (weather_info.pressure > 1015 ? -2 : 2); 

        My C still sucks :) I normaly was a pascal person.. but what does 
this do?   the (weather_info.pressure > 985    i think may return a 0 if 
the statement is true and a nonzero if its false.. but then what does the 
? -2 : 2)   do? This is the first time I've ever seen something like 
that... some sort of math operator or comparison or something? can 
someone please explain what that statement does?

	Also. I want to create seperate weather conditions for each zone 
and add a weather info variable to the .zon files to state the standard 
conditions the zone is usualy in.. But I need to know how to make a 
weather thing for each zone.. would something like

struct weather_data[max_zones] *weather_info 
 work? then I could do a for ... max_zones in weather.c to individualy 
cycle through each zone? or some zones would "Share" weather because they 
are alike. and would that slow the mud down to have to cycle through 
30-80 zones every time a weather update is called?

This archive was generated by hypermail 2b30 : 12/07/00 PST