Core/Misc: Moved CanSpeak() method to WorldSession class
Port From (https://github.com/TrinityCore/TrinityCore/commit/93aa30f4474254b9db69025e7864a124028273c0)
This commit is contained in:
@@ -1759,7 +1759,7 @@ namespace Game.Chat
|
||||
|
||||
if (target)
|
||||
{
|
||||
if (target.CanSpeak())
|
||||
if (target.GetSession().CanSpeak())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.ChatAlreadyEnabled);
|
||||
return false;
|
||||
|
||||
@@ -5783,11 +5783,6 @@ namespace Game.Entities
|
||||
UpdateItemLevelAreaBasedScaling();
|
||||
}
|
||||
|
||||
public bool CanSpeak()
|
||||
{
|
||||
return GetSession().m_muteTime <= Time.UnixTime;
|
||||
}
|
||||
|
||||
public void RemoveSocial()
|
||||
{
|
||||
Global.SocialMgr.RemovePlayerSocial(GetGUID());
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Game
|
||||
lang = (Language)ModLangAuras.FirstOrDefault().GetMiscValue();
|
||||
}
|
||||
|
||||
if (!sender.CanSpeak())
|
||||
if (!CanSpeak())
|
||||
{
|
||||
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - Time.UnixTime));
|
||||
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
||||
@@ -555,7 +555,7 @@ namespace Game
|
||||
if (!GetPlayer().IsAlive())
|
||||
return;
|
||||
|
||||
if (!GetPlayer().CanSpeak())
|
||||
if (!CanSpeak())
|
||||
{
|
||||
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - Time.UnixTime));
|
||||
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
||||
|
||||
@@ -554,6 +554,11 @@ namespace Game
|
||||
SendPacket(packet);
|
||||
}
|
||||
|
||||
public bool CanSpeak()
|
||||
{
|
||||
return m_muteTime <= GameTime.GetGameTime();
|
||||
}
|
||||
|
||||
public void SendNotification(CypherStrings str, params object[] args)
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(str), args);
|
||||
|
||||
Reference in New Issue
Block a user