mail[Wesnoth-commits] r33442 - /trunk/src/actions.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on March 08, 2009 - 17:58:
Author: alink
Date: Sun Mar  8 17:58:35 2009
New Revision: 33442

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33442&view=rev
Log:
When there is stoned units, use some order of sighted events with "Delay 
shroud
update" as with normal moves (safer for replay)

Modified:
    trunk/src/actions.cpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=33442&r1=33441&r2=33442&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sun Mar  8 17:58:35 2009
@@ -2613,18 +2613,17 @@
                        // known_units.insert(*step);
 
                        // Clear the shroud, and collect new seen_units
-                       //FIXME: we don't use a separate stoned_units because 
I don't see the point
-                       // This avoid to change the sighted order (more risky 
here)
-                       // but must be cleaned (the function or the call)
                        std::set<map_location> seen_units;
+                       std::set<map_location> stoned_units;
                        cleared_shroud |= 
clear_shroud_unit(map,units,*step,teams,team,
-                               &known_units,&seen_units,&seen_units);
-
+                               &known_units,&seen_units,&stoned_units);
+
+                       // Fire sighted events
+                       // Try to keep same order (stoned units after normal 
units)
+                       // as with move_unit for replay
                        for (std::set<map_location>::iterator sight_it = 
seen_units.begin();
                                sight_it != seen_units.end(); ++sight_it)
                        {
-                               known_units.insert(*sight_it);
-
                                unit_map::const_iterator new_unit = 
units.find(*sight_it);
                                assert(new_unit != units.end());
                                teams[team].see(new_unit->second.side()-1);
@@ -2632,7 +2631,16 @@
                                
game_events::raise("sighted",*sight_it,unit_itor->first);
                                sighted_event = true;
                        }
-
+                       for (std::set<map_location>::iterator sight_it = 
stoned_units.begin();
+                               sight_it != stoned_units.end(); ++sight_it)
+                       {
+                               unit_map::const_iterator new_unit = 
units.find(*sight_it);
+                               assert(new_unit != units.end());
+                               teams[team].see(new_unit->second.side()-1);
+
+                               
game_events::raise("sighted",*sight_it,unit_itor->first);
+                               sighted_event = true;
+                       }
                }
        }
 




Related Messages


Powered by MHonArc, Updated Sun Mar 08 18:20:35 2009