Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Server/Cinematic: remove unneded cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Feb 24, 2024
1 parent 1a8b118 commit 603e0dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/server/game/Cinematic/CinematicPathMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ size_t CinematicSequenceMgr::Load()
//////////////////////////////////////////////////////////////////////////

/// Get a sequence by his id
CinematicSequence const* CinematicSequenceMgr::GetSequence(uint32 p_SequenceID)
CinematicSequence const* CinematicSequenceMgr::GetSequence(uint32 sequenceID)
{
std::map<uint32, CinematicSequence*>::iterator itr = m_Sequences.find(p_SequenceID);
std::map<uint32, CinematicSequence*>::iterator itr = m_Sequences.find(sequenceID);

return (itr != m_Sequences.end()) ? itr->second : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Cinematic/CinematicPathMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CinematicSequenceMgr
size_t Load();

/// Get a sequence by his id
CinematicSequence const* GetSequence(uint32 p_SequenceID);
CinematicSequence const* GetSequence(uint32 sequenceID);

private:
std::map<uint32, CinematicSequence*> m_Sequences;
Expand Down
18 changes: 9 additions & 9 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,19 +1408,19 @@ void Player::Update(uint32 p_time)

if (inCinematic && cinematicSequence)
{
bool l_StartedAtClient = getMSTime() > cinematicClientStartTime;
uint32 l_Time = getMSTime() - cinematicClientStartTime;
bool startedAtClient = getMSTime() > cinematicClientStartTime;
uint32 time = getMSTime() - cinematicClientStartTime;

if (l_StartedAtClient)
if (startedAtClient)
{
if (l_Time > cinematicSequence->Duration)
if (time > cinematicSequence->Duration)
StopCinematic();
else if (l_StartedAtClient)
else if (startedAtClient)
{
Position l_NewPosition;
cinematicSequence->GetPositionAtTime(l_Time, &l_NewPosition.m_positionX, &l_NewPosition.m_positionY, &l_NewPosition.m_positionZ);
Position newPos;
cinematicSequence->GetPositionAtTime(time, &newPos.m_positionX, &newPos.m_positionY, &newPos.m_positionZ);

Unit::UpdatePosition(l_NewPosition.m_positionX, l_NewPosition.m_positionY, l_NewPosition.m_positionZ, 0, true);
Unit::UpdatePosition(newPos.m_positionX, newPos.m_positionY, newPos.m_positionZ, 0, true);
UpdateObjectVisibility();
SetFall(false);
}
Expand Down Expand Up @@ -6917,7 +6917,7 @@ void Player::SendCinematicStart(uint32 CinematicSequenceId)

StopCinematic();

cinematicSequence = const_cast<CinematicSequence*>(sCinematicSequenceMgr->GetSequence(CinematicSequenceId));
CinematicSequence const* cinematicSequence = sCinematicSequenceMgr->GetSequence(CinematicSequenceId);

if (cinematicSequence)
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -3553,7 +3553,7 @@ class Player : public Unit, public GridObject<Player>

uint32 _ConquestCurrencytotalWeekCap;

CinematicSequence * cinematicSequence;
CinematicSequence* cinematicSequence;
bool inCinematic;
uint32 cinematicClientStartTime;
float cinematicStartX, cinematicStartY, cinematicStartZ, cinematicStartO;
Expand Down

0 comments on commit 603e0dd

Please sign in to comment.