Fixed transport disappearing
This commit is contained in:
@@ -22675,19 +22675,30 @@ bool Player::IsVisibleGloballyFor(Player const* u) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
inline void UpdateVisibilityOf_helper(T* /*target*/, std::vector<Unit*>& /*v*/)
|
inline void UpdateVisibilityOf_helper(Player::ClientGUIDs& s64, T* target, std::vector<Unit*>& /*v*/)
|
||||||
{
|
{
|
||||||
|
s64.insert(target->GetGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline void UpdateVisibilityOf_helper(Creature* target, std::vector<Unit*>& v)
|
inline void UpdateVisibilityOf_helper(Player::ClientGUIDs& s64, GameObject* target, std::vector<Unit*>& /*v*/)
|
||||||
{
|
{
|
||||||
|
// @HACK: This is to prevent objects like deeprun tram from disappearing when player moves far from its spawn point while riding it
|
||||||
|
if ((target->GetGOInfo()->type != GAMEOBJECT_TYPE_TRANSPORT))
|
||||||
|
s64.insert(target->GetGUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void UpdateVisibilityOf_helper(Player::ClientGUIDs& s64, Creature* target, std::vector<Unit*>& v)
|
||||||
|
{
|
||||||
|
s64.insert(target->GetGUID());
|
||||||
v.push_back(target);
|
v.push_back(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline void UpdateVisibilityOf_helper(Player* target, std::vector<Unit*>& v)
|
inline void UpdateVisibilityOf_helper(Player::ClientGUIDs& s64, Player* target, std::vector<Unit*>& v)
|
||||||
{
|
{
|
||||||
|
s64.insert(target->GetGUID());
|
||||||
v.push_back(target);
|
v.push_back(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22801,9 +22812,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::vector<Unit*>&
|
|||||||
if (CanSeeOrDetect(target, false, true))
|
if (CanSeeOrDetect(target, false, true))
|
||||||
{
|
{
|
||||||
target->BuildCreateUpdateBlockForPlayer(&data, this);
|
target->BuildCreateUpdateBlockForPlayer(&data, this);
|
||||||
m_clientGUIDs.insert(target->GetGUID());
|
UpdateVisibilityOf_helper(m_clientGUIDs, target, visibleNow);
|
||||||
|
|
||||||
UpdateVisibilityOf_helper(target, visibleNow);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user