Author: shadowmaster
Date: Thu May 29 23:48:06 2008
New Revision: 26917

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26917&view=rev
Log:
* Fix bug #11207 / debian bug #448193

Modified:
    trunk/src/game_events.cpp

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=26917&r1=26916&r2=26917&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Thu May 29 23:48:06 2008
@@ -2225,11 +2225,19 @@
                                        }
                                        
if(utils::string_bool(cfg["fire_event"])) {
                                                game_events::entity_location 
death_loc(un);
-                                               game_events::fire("die", 
death_loc, death_loc);
-                                               un = units->find(death_loc);
-                                               if(un != units->end() && 
death_loc.matches_unit(un->second)) {
-                                                       units->erase(un);
-                                                       unit_mutations++;
+                                               // Prevent infinite recursion 
of 'die' events
+                                               if (event_info.loc1 == 
death_loc && event_info.name == "die" && !this->first_time_only_)
+                                               {
+                                                       ERR_NG << "tried to 
fire 'die' event on primary_unit inside its own 'die' event with 
'first_time_only' set to false!\n";
+                                               }
+                                               else
+                                               {
+                                                       
game_events::fire("die", death_loc, death_loc);
+                                                       un = 
units->find(death_loc);
+                                                       if(un != units->end() 
&& death_loc.matches_unit(un->second)) {
+                                                               
units->erase(un);
+                                                               
unit_mutations++;
+                                                       }
                                                }
                                        } else {
                                                units->erase(un);


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to