summaryrefslogtreecommitdiff
path: root/src/modules/m_park.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_park.cpp')
-rw-r--r--src/modules/m_park.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp
index 9fbae3529..31da8f033 100644
--- a/src/modules/m_park.cpp
+++ b/src/modules/m_park.cpp
@@ -163,9 +163,11 @@ class cmd_unpark : public command_t
// first part the user from all chans theyre on, so things dont get messy
for (std::vector<ucrec*>::iterator i = user->chans.begin(); i != user->chans.end(); i++)
{
- if (((ucrec*)(*i))->channel != NULL)
+ chanrec* chan = (*i)->channel;
+ if (chan != NULL)
{
- Srv->PartUserFromChannel(user,((ucrec*)(*i))->channel->name,"Unparking");
+ if (!chan->PartUser(user, "Unparking"))
+ delete chan;
}
}
// remove all their old modes