feat(Core/SmartScripts): ACTION_GO_SET_GO_STATE

This commit is contained in:
IntelligentQuantum
2022-01-04 13:14:02 +03:30
committed by GitHub
parent 9faec8ef1b
commit 8fd757a152
3 changed files with 22 additions and 1 deletions

View File

@@ -2485,6 +2485,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsGameObject(*itr))
(*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state);
delete targets;
break;
}
case SMART_ACTION_GO_SET_GO_STATE:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
{
break;
}
for (auto const& target : *targets)
{
if (IsGameObject(target))
{
target->ToGameObject()->SetGoState((GOState)e.action.goState.state);
}
}
delete targets;
break;
}