fix(Core/Transports): Added Arrival bell sound for boats. (#14272)

Fixes #11340
This commit is contained in:
UltraNix
2022-12-25 14:35:55 +01:00
committed by GitHub
parent a8cd4c91a0
commit 0c1b967f9b
3 changed files with 51 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
--
DELETE FROM `event_scripts` WHERE `id` IN (10301,10302,16395,16396,16397,16398,16399,16400,16401,16402,16522,19030,19031,19032,19033,19123,19124);
INSERT INTO `event_scripts` VALUES
(10301,0,16,5495,2,0,0,0,0,0),
(10302,0,16,5495,2,0,0,0,0,0),
(16395,0,16,5495,2,0,0,0,0,0),
(16396,0,16,5495,2,0,0,0,0,0),
(16397,0,16,5495,2,0,0,0,0,0),
(16398,0,16,5495,2,0,0,0,0,0),
(16399,0,16,5495,2,0,0,0,0,0),
(16400,0,16,5495,2,0,0,0,0,0),
(16401,0,16,5495,2,0,0,0,0,0),
(16402,0,16,5495,2,0,0,0,0,0),
(16522,0,16,5495,2,0,0,0,0,0),
(19030,0,16,5495,2,0,0,0,0,0),
(19031,0,16,5495,2,0,0,0,0,0),
(19032,0,16,5495,2,0,0,0,0,0),
(19033,0,16,5495,2,0,0,0,0,0),
(19123,0,16,5495,2,0,0,0,0,0),
(19124,0,16,5495,2,0,0,0,0,0);

View File

@@ -11152,6 +11152,35 @@ WorldLocation Player::GetStartPosition() const
return WorldLocation(mapId, info->positionX, info->positionY, info->positionZ, 0);
}
bool Player::HaveAtClient(WorldObject const* u) const
{
if (u == this)
{
return true;
}
// Motion Transports are always present in player's client
if (GameObject const* gameobject = u->ToGameObject())
{
if (gameobject->IsMotionTransport())
{
return true;
}
}
return m_clientGUIDs.find(u->GetGUID()) != m_clientGUIDs.end();
}
bool Player::HaveAtClient(ObjectGuid guid) const
{
if (guid == GetGUID())
{
return true;
}
return m_clientGUIDs.find(guid) != m_clientGUIDs.end();
}
bool Player::IsNeverVisible() const
{
if (Unit::IsNeverVisible())

View File

@@ -2330,8 +2330,8 @@ public:
GuidUnorderedSet m_clientGUIDs;
std::vector<Unit*> m_newVisible; // pussywizard
bool HaveAtClient(WorldObject const* u) const { return u == this || m_clientGUIDs.find(u->GetGUID()) != m_clientGUIDs.end(); }
[[nodiscard]] bool HaveAtClient(ObjectGuid guid) const { return guid == GetGUID() || m_clientGUIDs.find(guid) != m_clientGUIDs.end(); }
[[nodiscard]] bool HaveAtClient(WorldObject const* u) const;
[[nodiscard]] bool HaveAtClient(ObjectGuid guid) const;
[[nodiscard]] bool IsNeverVisible() const override;