Author: esr
Date: Thu Oct 23 01:50:15 2008
New Revision: 30320

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30320&view=rev
Log:
Better error logging, from one of sukko's reverted commits.  No game effects.

Modified:
    trunk/src/ai.cpp

Modified: trunk/src/ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai.cpp?rev=30320&r1=30319&r2=30320&view=diff
==============================================================================
--- trunk/src/ai.cpp (original)
+++ trunk/src/ai.cpp Thu Oct 23 01:50:15 2008
@@ -1262,6 +1262,15 @@
        // Stop the user from issuing any commands while the unit is attacking
        const events::command_disabler disable_commands;
 
+       if(!info_.units.count(u))
+       {
+               ERR_AI << "attempt to attack without attacker\n";
+       }
+       if (!info_.units.count(target)) 
+       {
+               ERR_AI << "attempt to attack without defender\n";
+       }
+
        if(info_.units.count(u) && info_.units.count(target)) {
                if(info_.units.find(target)->second.incapacitated()) {
                        LOG_STREAM(err, ai) << "attempt to attack unit that is 
turned to stone\n";
@@ -1522,6 +1531,8 @@
                if(move.second.valid() == false) {
                        return true;
                }
+               assert (map_.on_board(move.first)
+                       && map_.on_board(move.second));
 
                LOG_AI << "move: " << move.first << " -> " << move.second << 
'\n';
 


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

Reply via email to