[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src map_event_handler.cc,1.3,1.4
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src map_event_handler.cc,1.3,1.4 |
Date: |
Sun, 18 Aug 2002 18:34:37 -0400 |
Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv31043
Modified Files:
map_event_handler.cc
Log Message:
FIXED crash when map_event used up it's repeat-count
Index: map_event_handler.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/map_event_handler.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** map_event_handler.cc 18 Aug 2002 19:53:17 -0000 1.3
--- map_event_handler.cc 18 Aug 2002 22:34:35 -0000 1.4
***************
*** 29,47 ****
void map_event_handler::raise_event (const event* e)
{
! vector<event*>::iterator j;
!
! // As long as matching events are in the list
! for (vector<event*>::iterator i = Events.begin (); i != Events.end ();)
{
! j = i;
! j++;
! if ((*i)->equals (e))
! // execute them. Note that events that use up their repeat
! // count are automatically deleted and unregistered.
! (*i)->execute (e);
!
! i = j;
}
return;
}
--- 29,44 ----
void map_event_handler::raise_event (const event* e)
{
! // we have to iterate back to front as executing an event might
! // erase it from the vector. This invalidates any iterators pointing
! // _after_ the deleted element.
! for (vector<event*>::iterator i = Events.end (); i > Events.begin ();)
{
! i--;
! // if the events match, execute them. Note that events that use up
! // their repeat count are automatically deleted and unregistered.
! if ((*i)->equals (e)) (*i)->execute (e);
}
+
return;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src map_event_handler.cc,1.3,1.4,
Kai Sterker <address@hidden> <=
- Prev by Date:
[Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters Makefile.am,1.12,1.13 alek.py,1.4,1.5 fellnir.py,1.5,1.6 frostbloom.py,1.5,1.6 janesta.py,1.4,1.5 jelom.py,1.4,1.5 lucia.py,1.6,1.7 oliver.py,1.6,1.7 orloth.py,1.5,1.6 sarin.py,1.5,1.6 schedule.py,1.1,1.2 silverhair.py,1.4,1.5 talan.py,1.4,1.5 tristan.py,1.5,1.6
- Next by Date:
[Adonthell-commits] CVS: adonthell/src event.cc,1.16,1.17 gamedata.cc,1.24,1.25 mapcharacter.cc,1.45,1.46 mapcharacter.h,1.55,1.56 py_callback.cc,1.7,1.8 py_callback.h,1.3,1.4
- Previous by thread:
[Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters Makefile.am,1.12,1.13 alek.py,1.4,1.5 fellnir.py,1.5,1.6 frostbloom.py,1.5,1.6 janesta.py,1.4,1.5 jelom.py,1.4,1.5 lucia.py,1.6,1.7 oliver.py,1.6,1.7 orloth.py,1.5,1.6 sarin.py,1.5,1.6 schedule.py,1.1,1.2 silverhair.py,1.4,1.5 talan.py,1.4,1.5 tristan.py,1.5,1.6
- Next by thread:
[Adonthell-commits] CVS: adonthell/src event.cc,1.16,1.17 gamedata.cc,1.24,1.25 mapcharacter.cc,1.45,1.46 mapcharacter.h,1.55,1.56 py_callback.cc,1.7,1.8 py_callback.h,1.3,1.4
- Index(es):