Author: tschmitz
Date: Fri Aug 19 01:38:30 2011
New Revision: 50842
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50842&view=rev
Log:
Fixed bug with contextual execute.
Modified:
trunk/src/whiteboard/highlight_visitor.cpp
Modified: trunk/src/whiteboard/highlight_visitor.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/highlight_visitor.cpp?rev=50842&r1=50841&r2=50842&view=diff
==============================================================================
--- trunk/src/whiteboard/highlight_visitor.cpp (original)
+++ trunk/src/whiteboard/highlight_visitor.cpp Fri Aug 19 01:38:30 2011
@@ -88,9 +88,12 @@
}
//Set the execution/deletion/bump targets.
- side_actions::iterator itor =
side_actions_->find_first_action_of(owner_unit_);
- if(itor != side_actions_->end())
- selected_action_ = *itor;
+ if(owner_unit_)
+ {
+ side_actions::iterator itor =
side_actions_->find_first_action_of(owner_unit_);
+ if(itor != side_actions_->end())
+ selected_action_ = *itor;
+ }
//Overwrite the above selected_action_ if we find a better one
BOOST_REVERSE_FOREACH(action_ptr act, *side_actions_)
{
@@ -112,6 +115,7 @@
main_highlight_.reset();
owner_unit_ = NULL;
secondary_highlights_.clear();
+ selected_action_.reset();
}
void highlight_visitor::highlight()
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits