mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 11:43:18 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user