src/engine.cpp
changeset 9659 187142ff9b6c
parent 9468 7087fa70cfd4
child 9709 fc8c47cbfcf2
equal deleted inserted replaced
9658:f5c4d3c04b5d 9659:187142ff9b6c
   311 
   311 
   312 	do {
   312 	do {
   313 		best_hist = -1;
   313 		best_hist = -1;
   314 		best_player = PLAYER_SPECTATOR;
   314 		best_player = PLAYER_SPECTATOR;
   315 		FOR_ALL_PLAYERS(p) {
   315 		FOR_ALL_PLAYERS(p) {
   316 			if (p->is_active && p->block_preview == 0 && !HasBit(mask, p->index) &&
   316 			if (p->block_preview == 0 && !HasBit(mask, p->index) &&
   317 					p->old_economy[0].performance_history > best_hist) {
   317 					p->old_economy[0].performance_history > best_hist) {
   318 				best_hist = p->old_economy[0].performance_history;
   318 				best_hist = p->old_economy[0].performance_history;
   319 				best_player = p->index;
   319 				best_player = p->index;
   320 			}
   320 			}
   321 		}
   321 		}
   426 
   426 
   427 	if (e->type == VEH_TRAIN) {
   427 	if (e->type == VEH_TRAIN) {
   428 		/* maybe make another rail type available */
   428 		/* maybe make another rail type available */
   429 		RailType railtype = e->u.rail.railtype;
   429 		RailType railtype = e->u.rail.railtype;
   430 		assert(railtype < RAILTYPE_END);
   430 		assert(railtype < RAILTYPE_END);
   431 		FOR_ALL_PLAYERS(p) {
   431 		FOR_ALL_PLAYERS(p) SetBit(p->avail_railtypes, railtype);
   432 			if (p->is_active) SetBit(p->avail_railtypes, railtype);
       
   433 		}
       
   434 	} else if (e->type == VEH_ROAD) {
   432 	} else if (e->type == VEH_ROAD) {
   435 		/* maybe make another road type available */
   433 		/* maybe make another road type available */
   436 		FOR_ALL_PLAYERS(p) {
   434 		FOR_ALL_PLAYERS(p) SetBit(p->avail_roadtypes, HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
   437 			if (p->is_active) SetBit(p->avail_roadtypes, HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
       
   438 		}
       
   439 	}
   435 	}
   440 
   436 
   441 	SetDParam(0, GetEngineCategoryName(index));
   437 	SetDParam(0, GetEngineCategoryName(index));
   442 	SetDParam(1, index);
   438 	SetDParam(1, index);
   443 	AddNewsItem(STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE, NS_NEW_VEHICLES, index, 0);
   439 	AddNewsItem(STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE, NS_NEW_VEHICLES, index, 0);