disaster_cmd.c
changeset 2655 1ff3459b4c84
parent 2648 677ba48b2549
child 2662 8b46824bd821
equal deleted inserted replaced
2654:1370de8783d3 2655:1ff3459b4c84
   939 	Disaster5_Init,
   939 	Disaster5_Init,
   940 	Disaster6_Init,
   940 	Disaster6_Init,
   941 	Disaster7_Init,
   941 	Disaster7_Init,
   942 };
   942 };
   943 
   943 
   944 typedef struct {
   944 #define MK(a, b) { (a) - MAX_YEAR_BEGIN_REAL, (b) - MAX_YEAR_BEGIN_REAL }
   945 	byte min,max;
   945 static const struct {
   946 } DisasterYears;
   946 	byte min;
   947 
   947 	byte max;
   948 #define MK(a,b) {a-20,b-20}
   948 } _dis_years[] = {
   949 static const DisasterYears _dis_years[8] = {
   949 	MK(1930, 1955),
   950 	MK(30,55),
   950 	MK(1940, 1970),
   951 	MK(40,70),
   951 	MK(1960, 1990),
   952 	MK(60,90),
   952 	MK(1970, 2000),
   953 	MK(70,100),
   953 	MK(2000, 2100),
   954 	MK(100,200),
   954 	MK(1940, 1965),
   955 	MK(40,65),
   955 	MK(1975, 2010),
   956 	MK(75,110),
   956 	MK(1950, 1985)
   957 	MK(50,85),
       
   958 };
   957 };
       
   958 #undef MK
   959 
   959 
   960 
   960 
   961 static void DoDisaster(void)
   961 static void DoDisaster(void)
   962 {
   962 {
   963 	byte buf[lengthof(_dis_years)];
   963 	byte buf[lengthof(_dis_years)];