Author: tschmitz
Date: Sun Jul 24 23:41:01 2011
New Revision: 50397
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50397&view=rev
Log:
Made execute-all stop upon unit-sighted.
Modified:
trunk/src/whiteboard/move.cpp
trunk/src/whiteboard/side_actions.cpp
Modified: trunk/src/whiteboard/move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/move.cpp?rev=50397&r1=50396&r2=50397&view=diff
==============================================================================
--- trunk/src/whiteboard/move.cpp (original)
+++ trunk/src/whiteboard/move.cpp Sun Jul 24 23:41:01 2011
@@ -245,11 +245,7 @@
unit_map::const_iterator unit_it;
- if (steps_finished && route_->steps.back() == final_location)
- {
- result = action::SUCCESS;
- }
- else if (final_location == route_->steps.front())
+ if (final_location == route_->steps.front())
{
WRN_WB << "Move execution resulted in zero movement.\n";
}
@@ -257,14 +253,14 @@
(unit_it = resources::units->find(final_location)) !=
resources::units->end()
&& unit_it->id() == unit_id_)
{
- if(unit_it->move_interrupted())
+ if (steps_finished && route_->steps.back() == final_location)
//reached destination
{
- // Move was interrupted, probably by enemy unit
sighted: let the game take care of it
+ // Everything went smoothly
result = action::SUCCESS;
}
- else // @todo: Verify this code path is possible...
+ else // Move was interrupted, probably by enemy unit sighted
{
- WRN_WB << "Move finished at (" << final_location << ")
instead of at (" << get_dest_hex() << "), analyzing\n";
+ LOG_WB << "Move finished at (" << final_location << ")
instead of at (" << get_dest_hex() << "), analyzing\n";
std::vector<map_location>::iterator start_new_path;
bool found = false;
for (start_new_path = route_->steps.begin();
((start_new_path != route_->steps.end()) && !found); ++start_new_path)
Modified: trunk/src/whiteboard/side_actions.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/side_actions.cpp?rev=50397&r1=50396&r2=50397&view=diff
==============================================================================
--- trunk/src/whiteboard/side_actions.cpp (original)
+++ trunk/src/whiteboard/side_actions.cpp Sun Jul 24 23:41:01 2011
@@ -184,6 +184,8 @@
resources::whiteboard->queue_net_cmd(make_net_cmd_remove(position));
actions_.erase(position);
}
+ else //action may have revised itself; let's tell our allies.
+
resources::whiteboard->queue_net_cmd(make_net_cmd_replace(position,*position));
switch(exec_result)
{
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits