mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/GameObjects: Add isUse parameter to GossipHello for distinction between CMSG_GAMEOBJECT_USE and CMSG_GAMEOBJECT_REPORT_USE
This commit is contained in:
@@ -1353,8 +1353,10 @@ class go_twilight_portal : public GameObjectScript
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
bool GossipHello(Player* player, bool isUse) override
|
||||
{
|
||||
if (!isUse)
|
||||
return true;
|
||||
if (_spellId != 0)
|
||||
player->CastSpell(player, _spellId, true);
|
||||
return true;
|
||||
|
||||
@@ -977,8 +977,11 @@ class go_celestial_planetarium_access : public GameObjectScript
|
||||
{
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
bool GossipHello(Player* player, bool isUse) override
|
||||
{
|
||||
if (!isUse)
|
||||
return true;
|
||||
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return true;
|
||||
|
||||
|
||||
@@ -834,12 +834,11 @@ class go_soulwell : public GameObjectScript
|
||||
{
|
||||
}
|
||||
|
||||
/// Due to the fact that this GameObject triggers CMSG_GAMEOBJECT_USE
|
||||
/// _and_ CMSG_GAMEOBJECT_REPORT_USE, this GossipHello hook is called
|
||||
/// twice. The script's handling is fine as it won't remove two charges
|
||||
/// on the well. We have to find how to segregate REPORT_USE and USE.
|
||||
bool GossipHello(Player* player) override
|
||||
bool GossipHello(Player* player, bool isUse) override
|
||||
{
|
||||
if (!isUse)
|
||||
return true;
|
||||
|
||||
Unit* owner = go->GetOwner();
|
||||
if (!owner || owner->GetTypeId() != TYPEID_PLAYER || !player->IsInSameRaidWith(owner->ToPlayer()))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user