mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
Merge branch 'tracerestrict' into tracerestrict-sx
This commit is contained in:
commit
feeae4a200
@ -1002,17 +1002,17 @@ CommandCost CmdProgramSignalTraceRestrictProgMgmt(TileIndex tile, DoCommandFlag
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case TRDCT_PROG_COPY: {
|
case TRDCT_PROG_COPY: {
|
||||||
TraceRestrictRemoveProgramMapping(self);
|
TraceRestrictRemoveProgramMapping(self);
|
||||||
|
|
||||||
|
TraceRestrictProgram *source_prog = GetTraceRestrictProgram(source, false);
|
||||||
|
if (source_prog && !source_prog->items.empty()) {
|
||||||
TraceRestrictProgram *prog = GetTraceRestrictProgram(self, true);
|
TraceRestrictProgram *prog = GetTraceRestrictProgram(self, true);
|
||||||
if (!prog) {
|
if (!prog) {
|
||||||
// allocation failed
|
// allocation failed
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
TraceRestrictProgram *source_prog = GetTraceRestrictProgram(source, false);
|
|
||||||
if (source_prog) {
|
|
||||||
prog->items = source_prog->items; // copy
|
prog->items = source_prog->items; // copy
|
||||||
}
|
|
||||||
prog->Validate();
|
prog->Validate();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1645,6 +1645,9 @@ private:
|
|||||||
*/
|
*/
|
||||||
void SetObjectToPlaceAction(int widget, CursorID cursor)
|
void SetObjectToPlaceAction(int widget, CursorID cursor)
|
||||||
{
|
{
|
||||||
|
if (this->current_placement_widget != -1 && widget != this->current_placement_widget) {
|
||||||
|
ResetObjectToPlace();
|
||||||
|
}
|
||||||
this->ToggleWidgetLoweredState(widget);
|
this->ToggleWidgetLoweredState(widget);
|
||||||
this->SetWidgetDirty(widget);
|
this->SetWidgetDirty(widget);
|
||||||
if (this->IsWidgetLowered(widget)) {
|
if (this->IsWidgetLowered(widget)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user