Author: suokko
Date: Thu Sep 18 22:43:47 2008
New Revision: 29541

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29541&view=rev
Log:
Fix temporary_unit_placer not to corrupting underlying id for real unit

Modified:
    trunk/src/actions.cpp
    trunk/src/unit_map.cpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=29541&r1=29540&r2=29541&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Thu Sep 18 22:43:47 2008
@@ -2236,7 +2236,8 @@
 
                                // We have to swap out any unit that is already 
in the hex,
                                // so we can put our unit there, then we'll 
swap back at the end.
-                               const temporary_unit_placer 
unit_placer(units,*step,ui->second);
+                               unit temp_unit(ui->second);
+                               const temporary_unit_placer 
unit_placer(units,*step,temp_unit);
                                if( team.auto_shroud_updates()) {
                                        should_clear_stack |= 
clear_shroud_unit(map,units,*step,teams,
                                                        
ui->second.side()-1,&known_units,&seen_units,&stoned_units);

Modified: trunk/src/unit_map.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_map.cpp?rev=29541&r1=29540&r2=29541&view=diff
==============================================================================
--- trunk/src/unit_map.cpp (original)
+++ trunk/src/unit_map.cpp Thu Sep 18 22:43:47 2008
@@ -489,9 +489,15 @@
                ERR_NG << "Trying to add " << p->second.name() << 
                        " - " << p->second.id() << 
                        " - " << p->second.underlying_id() <<
+                       " ("  << p->first.x <<
+                       ","   << p->first.y <<
+                       ") "  <<
                        " over " << iter->second.second->second.name() << 
                        " - " << iter->second.second->second.id() << 
-                       " - " << iter->second.second->second.underlying_id();
+                       " - " << iter->second.second->second.underlying_id() <<
+                       " ("  << iter->second.second->first.x <<
+                       ","   << iter->second.second->first.y <<
+                       ") \n";
 
                assert(false && "Duplicated underlying_id not allowed");
        }


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

Reply via email to