Author: gabba
Date: Fri Mar 30 21:17:58 2012
New Revision: 53703
URL: http://svn.gna.org/viewcvs/wesnoth?rev=53703&view=rev
Log:
Fix bug #19581 (Leader can move after a planned recall). Recall and recruit are
now treated the same way by the whiteboard when considering moving leaders.
Patch #3201 by ejls. Backported from rev #53699.
Modified:
branches/1.10/src/mouse_events.cpp
branches/1.10/src/whiteboard/manager.cpp
Modified: branches/1.10/src/mouse_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.10/src/mouse_events.cpp?rev=53703&r1=53702&r2=53703&view=diff
==============================================================================
--- branches/1.10/src/mouse_events.cpp (original)
+++ branches/1.10/src/mouse_events.cpp Fri Mar 30 21:17:58 2012
@@ -700,7 +700,7 @@
&&
!resources::whiteboard->allow_leader_to_move(*u))
{
gui2::show_transient_message(gui_->video(), "",
- _("You cannot move your leader away
from the keep with some planned recruits left."));
+ _("You cannot move your leader away
from the keep with some planned recruits or recalls left."));
if(next_unit)
*next_unit = steps.front();
Modified: branches/1.10/src/whiteboard/manager.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.10/src/whiteboard/manager.cpp?rev=53703&r1=53702&r2=53703&view=diff
==============================================================================
--- branches/1.10/src/whiteboard/manager.cpp (original)
+++ branches/1.10/src/whiteboard/manager.cpp Fri Mar 30 21:17:58 2012
@@ -23,6 +23,7 @@
#include "highlight_visitor.hpp"
#include "mapbuilder.hpp"
#include "move.hpp"
+#include "recall.hpp"
#include "recruit.hpp"
#include "side_actions.hpp"
#include "utility.hpp"
@@ -266,9 +267,12 @@
//Look for planned recruits that depend on this leader
foreach(action_const_ptr action, *viewer_actions())
{
- if(recruit_const_ptr recruit =
boost::dynamic_pointer_cast<class recruit const>(action))
- {
- if (can_recruit_on(*resources::game_map,
leader.get_location(), recruit->get_recruit_hex()))
+ recruit_const_ptr recruit = boost::dynamic_pointer_cast<class
recruit const>(action);
+ recall_const_ptr recall = boost::dynamic_pointer_cast<class
recall const>(action);
+ if(recruit || recall)
+ {
+ map_location const target_hex =
recruit?recruit->get_recruit_hex():recall->get_recall_hex();
+ if (can_recruit_on(*resources::game_map,
leader.get_location(), target_hex))
return false;
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits