Core/Player: Fix Scene blackscreen (#19473)

* Move Flags from DBCEnums.h to SceneMgr.h (nothing to do with any DB2)
* Send SMSG_CANCEL_SCENE if scene ends (canceled or completed)
This commit is contained in:
funjoker
2017-05-06 13:28:03 +02:00
committed by joschiwald
parent 2abfaecf0c
commit 0c3c5dd0e1
3 changed files with 16 additions and 10 deletions

View File

@@ -958,13 +958,4 @@ enum CurrencyTypes
CURRENCY_TYPE_ARTIFACT_KNOWLEDGE = 1171,
};
enum SceneFlags
{
SCENEFLAG_UNK1 = 0x01,
SCENEFLAG_UNK2 = 0x02,
SCENEFLAG_NOT_CANCELABLE = 0x04,
SCENEFLAG_UNK8 = 0x08,
SCENEFLAG_UNK16 = 0x10, // 16, most common value
};
#endif

View File

@@ -121,6 +121,9 @@ void SceneMgr::OnSceneCancel(uint32 sceneInstanceID)
RemoveAurasDueToSceneId(sceneTemplate->SceneId);
sScriptMgr->OnSceneCancel(GetPlayer(), sceneInstanceID, sceneTemplate);
if (sceneTemplate->PlaybackFlags & SCENEFLAG_CANCEL_AT_END)
CancelScene(sceneInstanceID, false);
}
void SceneMgr::OnSceneComplete(uint32 sceneInstanceID)
@@ -140,6 +143,9 @@ void SceneMgr::OnSceneComplete(uint32 sceneInstanceID)
RemoveAurasDueToSceneId(sceneTemplate->SceneId);
sScriptMgr->OnSceneComplete(GetPlayer(), sceneInstanceID, sceneTemplate);
if (sceneTemplate->PlaybackFlags & SCENEFLAG_CANCEL_AT_END)
CancelScene(sceneInstanceID, false);
}
bool SceneMgr::HasScene(uint32 sceneInstanceID, uint32 sceneScriptPackageId /*= 0*/) const

View File

@@ -19,7 +19,16 @@
#define SceneMgr_h__
#include "Common.h"
#include "DBCEnums.h"
enum SceneFlags
{
SCENEFLAG_UNK1 = 0x01,
SCENEFLAG_CANCEL_AT_END = 0x02,
SCENEFLAG_NOT_CANCELABLE = 0x04,
SCENEFLAG_UNK8 = 0x08,
SCENEFLAG_UNK16 = 0x10, // 16, most common value
SCENEFLAG_UNK32 = 0x20,
};
class Player;
struct Position;