fixed possible crash in cmd_NeonServ.mod/cmd_neonserv_mode.c
[NeonServV5.git] / src / modules / NeonServ.mod / event_neonserv_invite.c
index 40922086b4ef21e63239a8504d7530d242601a18..b777ebc82de72b20742855d2119b503f147de3b7 100644 (file)
@@ -1,4 +1,4 @@
-/* event_neonserv_invite.c - NeonServ v5.4
+/* event_neonserv_invite.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -16,6 +16,8 @@
  */
 
 static void neonserv_event_invite(struct ClientSocket *client, struct UserNode *user, char *channel) {
+       if(client->botid != BOTID)
+               return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `channel_name` = '%s' AND `botclass` = '%d'", escape_string(channel), client->botid);