Rename SCRIPT_COMMAND_MOD_UPDATEFIELD to SCRIPT_COMMAND_SET_FLAG to avoid confusion.

Also add a parameter ´apply´ (dataint). If 1, it will set the flag, if 0, it will remove it.
Note: currently only supports 32bit integers.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-03 18:16:07 +02:00
parent f346d779a5
commit 2cec9d276e
2 changed files with 5 additions and 2 deletions

View File

@@ -3939,7 +3939,10 @@ void Map::ScriptsProcess()
break;
}
source->SetFlag(step.script->datalong, step.script->datalong2);
if (step.script->dataint)
source->SetFlag(step.script->datalong, step.script->datalong2);
else
source->RemoveFlag(step.script->datalong, step.script->datalong2);
break;
}

View File

@@ -453,7 +453,7 @@ enum WorldStates
#define SCRIPT_COMMAND_MODEL 32 // datalong = model id
#define SCRIPT_COMMAND_CLOSE_GOSSIP 33 // close gossip window -- no values
#define SCRIPT_COMMAND_PLAYMOVIE 34 // datalong = movie id
#define SCRIPT_COMMAND_MOD_UPDATEFIELD 35 // datalong = index, datalong2 = newvalue
#define SCRIPT_COMMAND_SET_FLAG 35 // dataint: 1=apply,0=remove, datalong = index, datalong2 = newvalue
/// Storage class for commands issued for delayed execution
struct CliCommandHolder