src/engine.cpp
changeset 8220 97fb9c6afd8d
parent 8214 971f861d5543
child 8221 59791d0e0c04
equal deleted inserted replaced
8219:7d669654e1e4 8220:97fb9c6afd8d
   327 	e->player_avail = (byte)-1;
   327 	e->player_avail = (byte)-1;
   328 
   328 
   329 	/* Do not introduce new rail wagons */
   329 	/* Do not introduce new rail wagons */
   330 	if (IsWagon(index)) return;
   330 	if (IsWagon(index)) return;
   331 
   331 
   332 	if (index < NUM_TRAIN_ENGINES) {
   332 	if (e->type == VEH_TRAIN) {
   333 		/* maybe make another rail type available */
   333 		/* maybe make another rail type available */
   334 		RailType railtype = RailVehInfo(index)->railtype;
   334 		RailType railtype = RailVehInfo(index)->railtype;
   335 		assert(railtype < RAILTYPE_END);
   335 		assert(railtype < RAILTYPE_END);
   336 		FOR_ALL_PLAYERS(p) {
   336 		FOR_ALL_PLAYERS(p) {
   337 			if (p->is_active) SetBit(p->avail_railtypes, railtype);
   337 			if (p->is_active) SetBit(p->avail_railtypes, railtype);
   338 		}
   338 		}
   339 	}
   339 	} else if (e->type == VEH_ROAD) {
   340 	if ((index - NUM_TRAIN_ENGINES) < NUM_ROAD_ENGINES) {
       
   341 		/* maybe make another road type available */
   340 		/* maybe make another road type available */
   342 		FOR_ALL_PLAYERS(p) {
   341 		FOR_ALL_PLAYERS(p) {
   343 			if (p->is_active) SetBit(p->avail_roadtypes, HasBit(EngInfo(index)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
   342 			if (p->is_active) SetBit(p->avail_roadtypes, HasBit(EngInfo(index)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
   344 		}
   343 		}
   345 	}
   344 	}