newgrf_station.c
changeset 5172 285d1ab82403
parent 4817 116374e1a5f1
child 5380 8ea58542b6e0
equal deleted inserted replaced
5171:f20818dab924 5172:285d1ab82403
   369 		case 0xF0: return st->facilities;
   369 		case 0xF0: return st->facilities;
   370 		case 0xF1: return st->airport_type;
   370 		case 0xF1: return st->airport_type;
   371 		case 0xF2: return st->truck_stops->status;
   371 		case 0xF2: return st->truck_stops->status;
   372 		case 0xF3: return st->bus_stops->status;
   372 		case 0xF3: return st->bus_stops->status;
   373 		case 0xF6: return st->airport_flags;
   373 		case 0xF6: return st->airport_flags;
   374 		case 0xF7: return st->airport_flags & 0xFF;
   374 		case 0xF7: return GB(st->airport_flags, 8, 8);
   375 		case 0xFA: return max(st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0);
   375 		case 0xFA: return max(st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0);
   376 	}
   376 	}
   377 
   377 
   378 	/* Handle cargo variables (deprecated) */
   378 	/* Handle cargo variables (deprecated) */
   379 	if (variable >= 0x8C && variable <= 0xEC) {
   379 	if (variable >= 0x8C && variable <= 0xEC) {
   380 		const GoodsEntry *g = &st->goods[GB(variable - 0x8C, 3, 4)];
   380 		const GoodsEntry *g = &st->goods[GB(variable - 0x8C, 3, 4)];
   381 		switch (GB(variable - 0x8C, 0, 3)) {
   381 		switch (GB(variable - 0x8C, 0, 3)) {
   382 			case 0: return g->waiting_acceptance;
   382 			case 0: return g->waiting_acceptance;
   383 			case 1: return g->waiting_acceptance & 0xFF;
   383 			case 1: return GB(g->waiting_acceptance, 8, 8);
   384 			case 2: return g->days_since_pickup;
   384 			case 2: return g->days_since_pickup;
   385 			case 3: return g->rating;
   385 			case 3: return g->rating;
   386 			case 4: return g->enroute_from;
   386 			case 4: return g->enroute_from;
   387 			case 5: return g->enroute_time;
   387 			case 5: return g->enroute_time;
   388 			case 6: return g->last_speed;
   388 			case 6: return g->last_speed;