aboutsummaryrefslogtreecommitdiff
path: root/src/game/Channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Channel.cpp')
-rw-r--r--src/game/Channel.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp
index 8d61dd733ea..4799539ac62 100644
--- a/src/game/Channel.cpp
+++ b/src/game/Channel.cpp
@@ -300,10 +300,11 @@ void Channel::Password(uint64 p, const char *pass)
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
{
- uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
- if(plr)
- sec = plr->GetSession()->GetSecurity();
+ if (!plr)
+ return;
+
+ uint32 sec = plr->GetSession()->GetSecurity();
if(!IsOn(p))
{
@@ -368,10 +369,11 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
void Channel::SetOwner(uint64 p, const char *newname)
{
- uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
- if(plr)
- sec = plr->GetSession()->GetSecurity();
+ if (!plr)
+ return;
+
+ uint32 sec = plr->GetSession()->GetSecurity();
if(!IsOn(p))
{