aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-11-23 12:30:11 +0100
committerSpp <spp@jorge.gr>2012-11-23 12:30:11 +0100
commit26006551e292d151bc28f6e136953b128b40a155 (patch)
tree3015dd482491f8858e70ea9bc0f7b469b49b7fa2 /src
parentb1ec4b61acd0cd8f19ec96f3452c99fd45ad9362 (diff)
Fix wrong replacement in 32c259b1ce (Fixes a minor error msg)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp13
-rwxr-xr-xsrc/server/game/Chat/Channels/ChannelMgr.cpp4
2 files changed, 12 insertions, 5 deletions
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index d252c571acb..cba38a3ebf1 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -479,7 +479,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
uint64 guid = player->GetGUID();
uint32 sec = player->GetSession()->GetSecurity();
- if (!IsOn(guid) || (!AccountMgr::IsGMAccount(sec) && guid != _ownerGUID))
+ if (!IsOn(guid))
{
WorldPacket data;
MakeNotMember(&data);
@@ -487,6 +487,14 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
return;
}
+ if (!AccountMgr::IsGMAccount(sec) && guid != _ownerGUID)
+ {
+ WorldPacket data;
+ MakeNotOwner(&data);
+ SendToOne(&data, guid);
+ return;
+ }
+
Player* newp = sObjectAccessor->FindPlayerByName(newname);
uint64 victim = newp ? newp->GetGUID() : 0;
@@ -600,8 +608,6 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL;
- Player* player = ObjectAccessor::FindPlayer(guid);
-
if (!IsOn(guid))
{
WorldPacket data;
@@ -627,6 +633,7 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
data << uint64(guid);
data << uint32(what.size() + 1);
data << what;
+ Player* player = ObjectAccessor::FindPlayer(guid);
data << uint8(player ? player->GetChatTag() : 0);
SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false);
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index bcb9ee61b78..acd85f11ed8 100755
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -42,7 +42,7 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team)
return NULL;
}
-Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channel_id)
+Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
{
std::wstring wname;
Utf8toWStr(name, wname);
@@ -52,7 +52,7 @@ Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channel_id)
if (i == channels.end())
{
- Channel* nchan = new Channel(name, channel_id, team);
+ Channel* nchan = new Channel(name, channelId, team);
channels[wname] = nchan;
return nchan;
}