Core/SmartScript: update ACTION_GO_SET_GO_STATE

GO_STATE_ACTIVE             = 0,                        // show in world as used and not reset (closed door open)
GO_STATE_READY              = 1,                        // show in world as ready (closed door close)
GO_STATE_ACTIVE_ALTERNATIVE = 2                         // show in world as used in alt way and not reset (closed door open by cannon fire)

Credits to Sunwell
This commit is contained in:
Kittnz authored and Aokromes committed 2016-12-28 16:10:44 +01:00
1 parent 0f734dc43a
commit a2e01f386a
3 files changed
+22 -1

No files matched your search

@@ -2062,6 +2062,20 @@ 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 (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsGameObject(*itr))
(*itr)->ToGameObject()->SetGoState((GOState)e.action.goState.state);
delete targets;
break;
}