[11005] Remove unused function from channel code. Some other cleanups.t_id

This commit is contained in:
VladimirMangos 2011-01-14 08:48:36 +03:00
parent 8d62e9dbf7
commit c8fe77f8ca
3 changed files with 4 additions and 24 deletions

View file

@ -579,7 +579,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
data << what; data << what;
data << uint8(plr ? plr->chatTag() : 0); data << uint8(plr ? plr->chatTag() : 0);
SendToAll(&data, !players[p].IsModerator() ? p : false); SendToAll(&data, !players[p].IsModerator() ? p : 0);
} }
} }
@ -664,33 +664,14 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
void Channel::SendToAll(WorldPacket *data, uint64 p) void Channel::SendToAll(WorldPacket *data, uint64 p)
{ {
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{ if (Player *plr = sObjectMgr.GetPlayer(i->first))
Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr)
{
if(!p || !plr->GetSocial()->HasIgnore(p)) if(!p || !plr->GetSocial()->HasIgnore(p))
plr->GetSession()->SendPacket(data); plr->GetSession()->SendPacket(data);
}
}
}
void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
{
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
if(i->first != who)
{
Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr)
plr->GetSession()->SendPacket(data);
}
}
} }
void Channel::SendToOne(WorldPacket *data, uint64 who) void Channel::SendToOne(WorldPacket *data, uint64 who)
{ {
Player *plr = sObjectMgr.GetPlayer(who); if (Player *plr = sObjectMgr.GetPlayer(who))
if(plr)
plr->GetSession()->SendPacket(data); plr->GetSession()->SendPacket(data);
} }

View file

@ -199,7 +199,6 @@ class Channel
void MakeVoiceOff(WorldPacket *data, uint64 guid); //+ 0x23 void MakeVoiceOff(WorldPacket *data, uint64 guid); //+ 0x23
void SendToAll(WorldPacket *data, uint64 p = 0); void SendToAll(WorldPacket *data, uint64 p = 0);
void SendToAllButOne(WorldPacket *data, uint64 who);
void SendToOne(WorldPacket *data, uint64 who); void SendToOne(WorldPacket *data, uint64 who);
bool IsOn(uint64 who) const { return players.find(who) != players.end(); } bool IsOn(uint64 who) const { return players.find(who) != players.end(); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11004" #define REVISION_NR "11005"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__