X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fevent_manager.h;h=54cd728bd6c375d513d85a273c68a9d5b293816c;hb=b5f7249a7edc25077d84b27b38552228b92ff763;hp=b33d5a29594ef89e9064425f5aa397a0236293fe;hpb=6c14025b2d416105915440e114de927c26e925ac;p=oweals%2Fminetest.git diff --git a/src/event_manager.h b/src/event_manager.h index b33d5a295..54cd728bd 100644 --- a/src/event_manager.h +++ b/src/event_manager.h @@ -1,24 +1,23 @@ /* -Minetest-c55 -Copyright (C) 2012 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +GNU Lesser General Public License for more details. -You should have received a copy of the GNU General Public License along +You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef EVENT_MANAGER_HEADER -#define EVENT_MANAGER_HEADER +#pragma once #include "event.h" #include @@ -53,7 +52,7 @@ public: if(i != m_dest.end()){ std::list &funcs = i->second.funcs; for(std::list::iterator i = funcs.begin(); - i != funcs.end(); i++){ + i != funcs.end(); ++i){ (*(i->f))(e, i->d); } } @@ -77,26 +76,26 @@ public: std::map::iterator i = m_dest.find(type); if(i != m_dest.end()){ std::list &funcs = i->second.funcs; - std::list::iterator i = funcs.begin(); - while(i != funcs.end()){ - bool remove = (i->f == f && (!data || i->d == data)); + std::list::iterator j = funcs.begin(); + while(j != funcs.end()){ + bool remove = (j->f == f && (!data || j->d == data)); if(remove) - funcs.erase(i++); + funcs.erase(j++); else - i++; + ++j; } } } else{ for(std::map::iterator - i = m_dest.begin(); i != m_dest.end(); i++){ + i = m_dest.begin(); i != m_dest.end(); ++i){ std::list &funcs = i->second.funcs; - std::list::iterator i = funcs.begin(); - while(i != funcs.end()){ - bool remove = (i->f == f && (!data || i->d == data)); + std::list::iterator j = funcs.begin(); + while(j != funcs.end()){ + bool remove = (j->f == f && (!data || j->d == data)); if(remove) - funcs.erase(i++); + funcs.erase(j++); else - i++; + ++j; } } } @@ -110,6 +109,3 @@ public: dereg(type, EventManager::receiverReceive, r); } }; - -#endif -