src/elrail.cpp
changeset 7931 b0a46cd92225
parent 7929 6c9b25842b0f
child 8083 ad22eade501f
equal deleted inserted replaced
7930:f12c2437a050 7931:b0a46cd92225
   272 			 * (TrackSourceTile) */
   272 			 * (TrackSourceTile) */
   273 			if (HasBit(trackconfig[TrackSourceTile[i][k]], TracksAtPCP[i][k])) {
   273 			if (HasBit(trackconfig[TrackSourceTile[i][k]], TracksAtPCP[i][k])) {
   274 				/* track found, if track is in the neighbour tile, adjust the number
   274 				/* track found, if track is in the neighbour tile, adjust the number
   275 				 * of the PCP for preferred/allowed determination*/
   275 				 * of the PCP for preferred/allowed determination*/
   276 				DiagDirection PCPpos = (TrackSourceTile[i][k] == TS_HOME) ? i : ReverseDiagDir(i);
   276 				DiagDirection PCPpos = (TrackSourceTile[i][k] == TS_HOME) ? i : ReverseDiagDir(i);
   277 				SETBIT(PCPstatus, i); // This PCP is in use
   277 				SetBit(PCPstatus, i); // This PCP is in use
   278 
   278 
   279 				PPPpreferred[i] &= PreferredPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
   279 				PPPpreferred[i] &= PreferredPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
   280 				PPPallowed[i] &= ~DisallowedPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
   280 				PPPallowed[i] &= ~DisallowedPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
   281 			}
   281 			}
   282 		}
   282 		}
   320 			Track bridgetrack = GetBridgeAxis(ti->tile) == AXIS_X ? TRACK_X : TRACK_Y;
   320 			Track bridgetrack = GetBridgeAxis(ti->tile) == AXIS_X ? TRACK_X : TRACK_Y;
   321 			uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
   321 			uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
   322 
   322 
   323 			if ((height <= GetTileMaxZ(ti->tile) + TILE_HEIGHT) &&
   323 			if ((height <= GetTileMaxZ(ti->tile) + TILE_HEIGHT) &&
   324 					(i == PCPpositions[bridgetrack][0] || i == PCPpositions[bridgetrack][1])) {
   324 					(i == PCPpositions[bridgetrack][0] || i == PCPpositions[bridgetrack][1])) {
   325 				SETBIT(OverridePCP, i);
   325 				SetBit(OverridePCP, i);
   326 			}
   326 			}
   327 		}
   327 		}
   328 
   328 
   329 		if (PPPallowed[i] != 0 && HasBit(PCPstatus, i) && !HasBit(OverridePCP, i)) {
   329 		if (PPPallowed[i] != 0 && HasBit(PCPstatus, i) && !HasBit(OverridePCP, i)) {
   330 			for (k = 0; k < DIR_END; k++) {
   330 			for (k = 0; k < DIR_END; k++) {
   502 			if (v->type == VEH_TRAIN && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
   502 			if (v->type == VEH_TRAIN && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
   503 				/* this railroad vehicle is now compatible only with elrail,
   503 				/* this railroad vehicle is now compatible only with elrail,
   504 				*  so add there also normal rail compatibility */
   504 				*  so add there also normal rail compatibility */
   505 				v->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
   505 				v->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
   506 				v->u.rail.railtype = RAILTYPE_RAIL;
   506 				v->u.rail.railtype = RAILTYPE_RAIL;
   507 				SETBIT(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
   507 				SetBit(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
   508 			}
   508 			}
   509 		}
   509 		}
   510 	}
   510 	}
   511 
   511 
   512 	/* setup total power for trains */
   512 	/* setup total power for trains */