progsig: Fix remove and clone program functions being completely broken.
Remove function only removed instructions from the local machine, and was therefore not MP safe. Clone function failed to work correctly for non-trivial cases, and sometimes caused an array out of bounds assertion. These are replaced by a new commandproc which does each operation as a single action, which is therefore MP safe. Remove an unused struct field.
This commit is contained in:
@@ -201,6 +201,7 @@ CommandProc CmdOpenCloseAirport;
|
||||
CommandProc CmdInsertSignalInstruction;
|
||||
CommandProc CmdModifySignalInstruction;
|
||||
CommandProc CmdRemoveSignalInstruction;
|
||||
CommandProc CmdSignalProgramMgmt;
|
||||
|
||||
#define DEF_CMD(proc, flags, type) {proc, #proc, (CommandFlags)flags, type}
|
||||
|
||||
@@ -362,6 +363,7 @@ static const Command _command_proc_table[] = {
|
||||
DEF_CMD(CmdInsertSignalInstruction, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_INSERT_SIGNAL_INSTRUCTION
|
||||
DEF_CMD(CmdModifySignalInstruction, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_MODIFY_SIGNAL_INSTRUCTION
|
||||
DEF_CMD(CmdRemoveSignalInstruction, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_SIGNAL_INSTRUCTION
|
||||
DEF_CMD(CmdSignalProgramMgmt, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_SIGNAL_PROGRAM_MGMT
|
||||
};
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user