Trace restrict: add train ownership conditional.

Infra sharing whitespace fix.
This commit is contained in:
Jonathan G Rennison
2015-12-15 20:30:20 +00:00
parent 95c532b134
commit 7673436d3a
9 changed files with 127 additions and 5 deletions

View File

@@ -110,7 +110,7 @@ enum TraceRestrictItemType {
TRIT_COND_CARGO = 15, ///< Test if train can carry cargo type
TRIT_COND_ENTRY_DIRECTION = 16, ///< Test which side of signal/signal tile is being entered from
TRIT_COND_PBS_ENTRY_SIGNAL = 17, ///< Test tile and PBS-state of previous signal
//TRIT_COND_TRAIN_OWNER = 24, ///< Test train owner: reserved for future use
TRIT_COND_TRAIN_OWNER = 24, ///< Test train owner
/* space up to 31 */
};
@@ -407,6 +407,7 @@ enum TraceRestrictValueType {
TRVT_TILE_INDEX = 8, ///< takes a TileIndex in the next item slot
TRVT_PF_PENALTY = 9, ///< takes a pathfinder penalty value or preset index, as per the auxiliary field as type: TraceRestrictPathfinderPenaltyAuxField
TRVT_RESERVE_THROUGH = 10,///< takes a value 0 = reserve through, 1 = cancel previous reserve through
TRVT_OWNER = 11,///< takes a CompanyID
};
/**
@@ -468,6 +469,11 @@ static inline TraceRestrictTypePropertySet GetTraceRestrictTypeProperties(TraceR
out.cond_type = TRCOT_BINARY;
break;
case TRIT_COND_TRAIN_OWNER:
out.value_type = TRVT_OWNER;
out.cond_type = TRCOT_BINARY;
break;
default:
NOT_REACHED();
break;
@@ -560,5 +566,6 @@ CommandCost CmdProgramSignalTraceRestrictProgMgmt(TileIndex tile, DoCommandFlag
void ShowTraceRestrictProgramWindow(TileIndex tile, Track track);
void TraceRestrictRemoveDestinationID(TraceRestrictOrderCondAuxField type, uint16 index);
void TraceRestrictUpdateCompanyID(CompanyID old_company, CompanyID new_company);
#endif /* TRACERESTRICT_H */