]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_park.cpp
Improved strhashcomp with no allocations
[user/henk/code/inspircd.git] / src / modules / m_park.cpp
index 8c529ba979895b65f361716d33420bfc81884078..29ce2c1eb1cdcf36e514c92dda3bc713cf93c2c9 100644 (file)
@@ -42,7 +42,7 @@ class parkedinfo
        time_t parktime;
 };
 
-Server *Srv;
+static Server *Srv;
 typedef std::vector<awaymsg> awaylog;
 typedef std::vector<parkedinfo> parkinfo;
 parkinfo pinfo;
@@ -153,14 +153,11 @@ class cmd_unpark : public command_t
                if (key == atoi(parameters[1]))
                {
                        // first part the user from all chans theyre on, so things dont get messy
-                       for (unsigned int i = 0; i < user->chans.size(); i++)
+                       for (std::vector<ucrec*>::iterator i = user->chans.begin(); i != user->chans.end(); i++)
                        {
-                               if (user->chans[i].channel != NULL)
-                               {
-                                       if (user->chans[i].channel->name)
-                                       {
-                                               Srv->PartUserFromChannel(user,user->chans[i].channel->name,"Unparking");
-                                       }
+                               if (((ucrec*)(*i))->channel != NULL)
+                               {
+                                       Srv->PartUserFromChannel(user,((ucrec*)(*i))->channel->name,"Unparking");
                                }
                        }
                        // remove all their old modes