autoSyndrome/syndromeTrigger: deal with overlap better for commands.

develop
expwnent 2013-05-12 12:43:45 -04:00
parent c127ad052e
commit 63e1f61f4f
3 changed files with 8 additions and 5 deletions

@ -827,8 +827,6 @@ It is not currently possible to execute more than one command per syndrome. Inst
Again, note that plugins AND scripts can be executed this way, and arguments will be passed according to the same rules.
If a command is executed, then the plugin will NOT apply the syndrome to any units. To call a dfhack command at the same time as applying a syndrome, use separate syndromes. This behavior is to prevent conflicts with the syndromeTrigger plugin.
syndromeTrigger
---------------
@ -842,6 +840,8 @@ The syntax is very similar to autoSyndrome. If the syndrome has the ``\\COMMAND`
3. ``\\SYNDROME_ID``: this will be replaced by the identifier of the syndrome in question.
If there is a ``[SYN_CLASS:\\AUTO_SYNDROME]`` tag, then the command, if any, will NOT be executed by syndromeTrigger, because it should already have been executed by autoSyndrome.
True Transformation
+++++++++++++++++++

@ -330,7 +330,6 @@ void processJob(color_ostream& out, void* jobPtr) {
if ( commandStr != "" ) {
Core::getInstance().runCommand(out, commandStr, args);
continue;
}
if ( destroyRock ) {

@ -56,6 +56,7 @@ void syndromeHandler(color_ostream& out, void* ptr) {
bool foundPermanent = false;
bool foundCommand = false;
bool foundAutoSyndrome = false;
string commandStr;
vector<string> args;
int32_t raceId = -1;
@ -100,7 +101,10 @@ void syndromeHandler(color_ostream& out, void* ptr) {
}
continue;
}
if ( clazz == "\\AUTO_SYNDROME" ) {
foundAutoSyndrome = true;
continue;
}
if ( clazz == "\\COMMAND" ) {
foundCommand = true;
continue;
@ -137,7 +141,7 @@ void syndromeHandler(color_ostream& out, void* ptr) {
}
}
if ( commandStr != "" ) {
if ( !foundAutoSyndrome && commandStr != "" ) {
Core::getInstance().runCommand(out, commandStr, args);
}