Add train can carry cargo condition variable.

This commit is contained in:
Jonathan G Rennison
2015-07-25 00:10:14 +01:00
parent 3a7a81e02f
commit 75869cae41
4 changed files with 103 additions and 7 deletions

View File

@@ -85,6 +85,7 @@ enum TraceRestrictItemType {
TRIT_COND_CURRENT_ORDER = 12, ///< Test train current order (station, waypoint or depot)
TRIT_COND_NEXT_ORDER = 13, ///< Test train next order (station, waypoint or depot)
TRIT_COND_LAST_STATION = 14, ///< Test train last visited station
TRIT_COND_CARGO = 15, ///< Test if train can carry cargo type
/* space up to 31 */
};
@@ -226,6 +227,7 @@ enum TraceRestrictValueType {
TRVT_DENY = 3, ///< takes a value 0 = deny, 1 = allow (cancel previous deny)
TRVT_SPEED = 4, ///< takes an integer speed value
TRVT_ORDER = 5, ///< takes an order target ID, as per the auxiliary field as type: TraceRestrictOrderCondAuxField
TRVT_CARGO_ID = 6, ///< takes a CargoID
};
void SetTraceRestrictValueDefault(TraceRestrictItem &item, TraceRestrictValueType value_type);
@@ -266,6 +268,11 @@ static inline TraceRestrictTypePropertySet GetTraceRestrictTypeProperties(TraceR
out.cond_type = TRCOT_BINARY;
break;
case TRIT_COND_CARGO:
out.value_type = TRVT_CARGO_ID;
out.cond_type = TRCOT_BINARY;
break;
default:
NOT_REACHED();
break;