mail[Wesnoth-commits] r44349 - /trunk/src/whiteboard/validate_visitor.cpp


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

Header


Content

Posted by gabrielmorin on July 19, 2010 - 11:04:
Author: gabba
Date: Mon Jul 19 11:04:20 2010
New Revision: 44349

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44349&view=rev
Log:
Whiteboard: Fix crash when a unit had a planned move to a hex which suddenly 
isn't available anymore because of a change in the planned actions.

Modified:
    trunk/src/whiteboard/validate_visitor.cpp

Modified: trunk/src/whiteboard/validate_visitor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/validate_visitor.cpp?rev=44349&r1=44348&r2=44349&view=diff
==============================================================================
--- trunk/src/whiteboard/validate_visitor.cpp (original)
+++ trunk/src/whiteboard/validate_visitor.cpp Mon Jul 19 11:04:20 2010
@@ -80,6 +80,10 @@
        if (!(move->source_hex_.valid() && move->dest_hex_.valid()))
                move->set_valid(false);
 
+       //verify that the destination hex is free
+       if (move->valid_ && (resources::units->find(move->dest_hex_) != 
resources::units->end()))
+               move->set_valid(false);
+
        //TODO: need to check if the unit in the source hex has the same 
underlying unit id as before,
        //i.e. that it's the same unit
        if (move->valid_ && resources::units->find(move->source_hex_) == 
resources::units->end())




Related Messages


Powered by MHonArc, Updated Mon Jul 19 11:20:13 2010