Remove unneeded SCRIPT_COMMAND_SET_FLAG that already was implemented in a different way.
(/blame Malcrom) --HG-- branch : trunk
This commit is contained in:
+9
-42
@@ -3023,11 +3023,10 @@ void Map::ScriptsProcess()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Source should only be Creature or GO, but in case of gossip, the target is our source.
|
|
||||||
Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature();
|
Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature();
|
||||||
if (!cSource)
|
if (!cSource)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id: %u) call for non-creature or non-GO source.", step.script->id);
|
sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id: %u) call for non-creature source.", step.script->id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3062,12 +3061,15 @@ void Map::ScriptsProcess()
|
|||||||
cSource->GetMap()->CreatureRelocation(cSource, step.script->x, step.script->y, step.script->z, 0);
|
cSource->GetMap()->CreatureRelocation(cSource, step.script->x, step.script->y, step.script->z, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SCRIPT_COMMAND_FLAG_SET:
|
case SCRIPT_COMMAND_FLAG_SET:
|
||||||
|
{
|
||||||
if (!source)
|
if (!source)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_FLAG_SET (script id: %u) call for NULL object.", step.script->id);
|
sLog.outError("SCRIPT_COMMAND_FLAG_SET (script id: %u) call for NULL object.", step.script->id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step.script->datalong <= OBJECT_FIELD_ENTRY || step.script->datalong >= source->GetValuesCount())
|
if (step.script->datalong <= OBJECT_FIELD_ENTRY || step.script->datalong >= source->GetValuesCount())
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_FLAG_SET (script id: %u) call for wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u).",
|
sLog.outError("SCRIPT_COMMAND_FLAG_SET (script id: %u) call for wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u).",
|
||||||
@@ -3077,7 +3079,10 @@ void Map::ScriptsProcess()
|
|||||||
|
|
||||||
source->SetFlag(step.script->datalong, step.script->datalong2);
|
source->SetFlag(step.script->datalong, step.script->datalong2);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SCRIPT_COMMAND_FLAG_REMOVE:
|
case SCRIPT_COMMAND_FLAG_REMOVE:
|
||||||
|
{
|
||||||
if (!source)
|
if (!source)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_FLAG_REMOVE (script id: %u) call for NULL object.", step.script->id);
|
sLog.outError("SCRIPT_COMMAND_FLAG_REMOVE (script id: %u) call for NULL object.", step.script->id);
|
||||||
@@ -3092,7 +3097,8 @@ void Map::ScriptsProcess()
|
|||||||
|
|
||||||
source->RemoveFlag(step.script->datalong, step.script->datalong2);
|
source->RemoveFlag(step.script->datalong, step.script->datalong2);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SCRIPT_COMMAND_TELEPORT_TO:
|
case SCRIPT_COMMAND_TELEPORT_TO:
|
||||||
{
|
{
|
||||||
// accept object in any one from target/source arg
|
// accept object in any one from target/source arg
|
||||||
@@ -3851,45 +3857,6 @@ void Map::ScriptsProcess()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SCRIPT_COMMAND_SET_FLAG:
|
|
||||||
{
|
|
||||||
if (!source)
|
|
||||||
{
|
|
||||||
sLog.outError("SCRIPT_COMMAND_MOD_UPDATEFIELD (script id: %u) call for NULL source.", step.script->id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16 maxOffset = 0;
|
|
||||||
switch (source->GetTypeId())
|
|
||||||
{
|
|
||||||
case TYPEID_ITEM:
|
|
||||||
maxOffset = ITEM_END;
|
|
||||||
break;
|
|
||||||
case TYPEID_UNIT:
|
|
||||||
maxOffset = UNIT_END;
|
|
||||||
break;
|
|
||||||
case TYPEID_PLAYER:
|
|
||||||
maxOffset = PLAYER_END;
|
|
||||||
break;
|
|
||||||
case TYPEID_GAMEOBJECT:
|
|
||||||
maxOffset = GAMEOBJECT_END;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step.script->datalong >= maxOffset || !step.script->datalong)
|
|
||||||
{
|
|
||||||
sLog.outError("SCRIPT_COMMAND_MOD_UPDATEFIELD (script id: %u). invalid index parameter (%u). maximum offset: (%u) for typeid %u",
|
|
||||||
step.script->id, step.script->datalong, maxOffset, source->GetTypeId());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step.script->dataint)
|
|
||||||
source->SetFlag(step.script->datalong, step.script->datalong2);
|
|
||||||
else
|
|
||||||
source->RemoveFlag(step.script->datalong, step.script->datalong2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sLog.outError("Unknown script command %u called.", step.script->command);
|
sLog.outError("Unknown script command %u called.", step.script->command);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -454,7 +454,6 @@ enum WorldStates
|
|||||||
#define SCRIPT_COMMAND_MODEL 32 // datalong = model id
|
#define SCRIPT_COMMAND_MODEL 32 // datalong = model id
|
||||||
#define SCRIPT_COMMAND_CLOSE_GOSSIP 33 // close gossip window -- no values
|
#define SCRIPT_COMMAND_CLOSE_GOSSIP 33 // close gossip window -- no values
|
||||||
#define SCRIPT_COMMAND_PLAYMOVIE 34 // datalong = movie id
|
#define SCRIPT_COMMAND_PLAYMOVIE 34 // datalong = movie id
|
||||||
#define SCRIPT_COMMAND_SET_FLAG 35 // dataint: 1=apply,0=remove, datalong = index, datalong2 = newvalue
|
|
||||||
|
|
||||||
/// Storage class for commands issued for delayed execution
|
/// Storage class for commands issued for delayed execution
|
||||||
struct CliCommandHolder
|
struct CliCommandHolder
|
||||||
|
|||||||
Reference in New Issue
Block a user