aboutsummaryrefslogtreecommitdiff
path: root/src/game/Channel.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-27 18:42:35 -0500
committermegamage <none@none>2009-04-27 18:42:35 -0500
commit09af28301e646bf75b63113129996724550d7dd6 (patch)
treea36f7bb0f369c13b71958f40e0247150417ba18e /src/game/Channel.cpp
parent5ac67c27f71a7b53fbce92ffdab3adb62b6baf0c (diff)
[7716] Fixed some typos and possible crashes. Author: AlexDereka
--HG-- branch : trunk
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))
{