Core/SmartScripts: Rename SMART_ACTION_RESPAWN_TARGET -> SMART_ACTION_ENABLE_TEMP_GOBJ, since that's the only thing it still does in the dynspawn model. Adjust body accordingly to warn on misuse.

This commit is contained in:
Treeston
2018-02-24 02:26:35 +01:00
parent 9f92896c52
commit 0850b5ff39
3 changed files with 13 additions and 9 deletions

View File

@@ -1454,19 +1454,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
break;
}
case SMART_ACTION_RESPAWN_TARGET:
case SMART_ACTION_ENABLE_TEMP_GOBJ:
{
for (WorldObject* target : targets)
{
if (IsCreature(target))
target->ToCreature()->Respawn();
TC_LOG_WARN("sql.sql", "Invalid creature target '%s' (entry %u, spawnId %u) specified for SMART_ACTION_ENABLE_TEMP_GOBJ", target->GetName().c_str(), target->GetEntry(), target->ToCreature()->GetSpawnId());
else if (IsGameObject(target))
{
// do not modify respawndelay of already spawned gameobjects
if (target->ToGameObject()->isSpawnedByDefault())
target->ToGameObject()->Respawn();
TC_LOG_WARN("sql.sql", "Invalid gameobject target '%s' (entry %u, spawnId %u) for SMART_ACTION_ENABLE_TEMP_GOBJ - the object is spawned by default", target->GetName().c_str(), target->GetEntry(), target->ToGameObject()->GetSpawnId());
else
target->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.goRespawnTime);
target->ToGameObject()->SetRespawnTime(e.action.enableTempGO.duration);
}
}
break;