From 3fd4f3d4b342a838b312ecc6bee4837c9a5584dd Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 4 Apr 2009 18:07:05 +0200 Subject: *added HandleGameObject function to instance, use this to simply open/close doors from scripts --HG-- branch : trunk --- src/game/InstanceData.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/game/InstanceData.cpp') diff --git a/src/game/InstanceData.cpp b/src/game/InstanceData.cpp index 28145973bc0..ac607bfd7ac 100644 --- a/src/game/InstanceData.cpp +++ b/src/game/InstanceData.cpp @@ -30,3 +30,13 @@ void InstanceData::SaveToDB() CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%d'", data.c_str(), instance->GetInstanceId()); } +void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go) +{ + if(!go) + go = instance->GetGameObjectInMap(GUID); + if(go) + go->SetGoState(open ? 0 : 1); + else + debug_log("SD2: InstanceData: HandleGameObject failed"); +} + -- cgit v1.2.3