Merge branch 'tracerestrict-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2016-07-18 00:48:12 +01:00
3 changed files with 24 additions and 12 deletions

View File

@@ -1439,21 +1439,25 @@ public:
TraceRestrictItem item = GetSelected();
if (GetTraceRestrictTypeProperties(item).value_type != TRVT_TILE_INDEX) return;
if (!IsPlainRailTile(tile)) {
ShowErrorMessage(error_message, STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, WL_INFO);
return;
}
if (GetPresentSignals(tile) == 0) {
ShowErrorMessage(error_message, STR_ERROR_THERE_ARE_NO_SIGNALS, WL_INFO);
return;
}
if (!IsTileOwner(tile, _local_company)) {
ShowErrorMessage(error_message, STR_ERROR_AREA_IS_OWNED_BY_ANOTHER, WL_INFO);
return;
}
if (IsRailDepotTile(tile)) {
// OK
} else {
if (!IsPlainRailTile(tile)) {
ShowErrorMessage(error_message, STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, WL_INFO);
return;
}
if (GetPresentSignals(tile) == 0) {
ShowErrorMessage(error_message, STR_ERROR_THERE_ARE_NO_SIGNALS, WL_INFO);
return;
}
}
TraceRestrictDoCommandP(this->tile, this->track, TRDCT_MODIFY_DUAL_ITEM, this->selected_instruction - 1, tile, STR_TRACE_RESTRICT_ERROR_CAN_T_MODIFY_ITEM);
}