Author: mordante
Date: Sat Oct 15 23:36:45 2011
New Revision: 51506

URL: http://svn.gna.org/viewcvs/wesnoth?rev=51506&view=rev
Log:
Remove the assert introduced in r51494.

anonymissimus found some valid cases which now assert. Changed it in a
debug warning, mainly to have hint that it might be the cause of an
issue.

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=51506&r1=51505&r2=51506&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sat Oct 15 23:36:45 2011
@@ -2801,12 +2801,13 @@
 {
        assert(resources::units);
 
-       /*
-        * This assert should be safe, but not 100% sure so if it fails need
-        * some extra validation code in this function.
-        */
-       assert(resources::units->has_unit(&u_));
-
+       if(!resources::units->has_unit(&u_)) {
+               /*
+                * It might be valid that the unit is not in the unit map.
+                * It might also mean a not longer valid unit will be assigned 
to.
+                */
+               DBG_UT << "The unit to be removed is not in the unit map.\n";
+       }
        u_.movement_ = moves_;
 }
 


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

Reply via email to