Merge branch 'tracerestrict-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2016-01-15 19:06:23 +00:00
2 changed files with 10 additions and 7 deletions

View File

@@ -1013,17 +1013,17 @@ CommandCost CmdProgramSignalTraceRestrictProgMgmt(TileIndex tile, DoCommandFlag
switch (type) {
case TRDCT_PROG_COPY: {
TraceRestrictRemoveProgramMapping(self);
TraceRestrictProgram *source_prog = GetTraceRestrictProgram(source, false);
if (source_prog && !source_prog->items.empty()) {
TraceRestrictProgram *prog = GetTraceRestrictProgram(self, true);
if (!prog) {
// allocation failed
return CMD_ERROR;
}
TraceRestrictProgram *source_prog = GetTraceRestrictProgram(source, false);
if (source_prog) {
prog->items = source_prog->items; // copy
}
prog->Validate();
}
break;
}

View File

@@ -1707,6 +1707,9 @@ private:
*/
void SetObjectToPlaceAction(int widget, CursorID cursor)
{
if (this->current_placement_widget != -1 && widget != this->current_placement_widget) {
ResetObjectToPlace();
}
this->ToggleWidgetLoweredState(widget);
this->SetWidgetDirty(widget);
if (this->IsWidgetLowered(widget)) {