diff options
| author | megamage <none@none> | 2009-04-05 16:25:00 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-04-05 16:25:00 -0500 |
| commit | 5acc0c057b247142a85cc94363afefa8fdefa5a1 (patch) | |
| tree | 7e7625f9945d0fed30c661b133dff363b03489fb /src | |
| parent | 81ef5e632fcfe9a565eebfea9556bde78c0a22e3 (diff) | |
[7612] Move SMSG_TRIGGER_CINEMATIC and SMSG_TRIGGER_MOVIE to functions and use its instead explicit packet creating. Author: NoFantasy
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/CharacterHandler.cpp | 20 | ||||
| -rw-r--r-- | src/game/GameObject.cpp | 9 | ||||
| -rw-r--r-- | src/game/Player.cpp | 14 | ||||
| -rw-r--r-- | src/game/Player.h | 3 |
4 files changed, 26 insertions, 20 deletions
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 1e118d2c04a..eaf0ec5af0f 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -711,23 +711,15 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) if(ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass())) { - if(cEntry->CinematicSequence) - { - data.Initialize(SMSG_TRIGGER_CINEMATIC, 4); - data << uint32(cEntry->CinematicSequence); - SendPacket( &data ); - } - else if(ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace())) - { - data.Initialize(SMSG_TRIGGER_CINEMATIC, 4); - data << uint32(rEntry->CinematicSequence); - SendPacket( &data ); - } - + if (cEntry->CinematicSequence) + pCurrChar->SendCinematicStart(cEntry->CinematicSequence); + else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace())) + pCurrChar->SendCinematicStart(rEntry->CinematicSequence); + // send new char string if not empty if (!sWorld.GetNewCharString().empty()) chH.PSendSysMessage(sWorld.GetNewCharString().c_str()); - } + } } if (!pCurrChar->GetMap()->Add(pCurrChar)) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 5c945000579..def17130372 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1050,12 +1050,9 @@ void GameObject::Use(Unit* user) Player* player = (Player*)user; - if(info->camera.cinematicId) - { - WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); - data << info->camera.cinematicId; - player->GetSession()->SendPacket(&data); - } + if (info->camera.cinematicId) + player->SendCinematicStart(info->camera.cinematicId); + return; } //fishing bobber diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e0f2a162b8d..a56403cc97f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5568,6 +5568,20 @@ void Player::SendDirectMessage(WorldPacket *data) GetSession()->SendPacket(data); } +void Player::SendCinematicStart(uint32 CinematicSequenceId) +{ + WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); + data << uint32(CinematicSequenceId); + SendDirectMessage(&data); +} + +void Player::SendMovieStart(uint32 MovieId) +{ + WorldPacket data(SMSG_TRIGGER_MOVIE, 4); + data << uint32(MovieId); + SendDirectMessage(&data); +} + void Player::CheckExploreSystem() { if (!isAlive()) diff --git a/src/game/Player.h b/src/game/Player.h index deafd63c0e9..087ca5e9cdc 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2001,6 +2001,9 @@ class TRINITY_DLL_SPEC Player : public Unit uint32 GetOldPetSpell() const { return m_oldpetspell; } void SetOldPetSpell(uint32 petspell) { m_oldpetspell = petspell; } + void SendCinematicStart(uint32 CinematicSequenceId); + void SendMovieStart(uint32 MovieId); + /*********************************************************/ /*** INSTANCE SYSTEM ***/ /*********************************************************/ |
