Author: ai0867
Date: Sat Oct 11 22:22:18 2008
New Revision: 30060
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30060&view=rev
Log:
* Catch end_turn_exception for non-humans.
Modified:
trunk/src/playmp_controller.cpp
trunk/src/playsingle_controller.cpp
Modified: trunk/src/playmp_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playmp_controller.cpp?rev=30060&r1=30059&r2=30060&view=diff
==============================================================================
--- trunk/src/playmp_controller.cpp (original)
+++ trunk/src/playmp_controller.cpp Sat Oct 11 22:22:18 2008
@@ -116,7 +116,13 @@
}
LOG_NG << "human finished turn...\n";
} else if(current_team().is_ai()) {
- play_ai_turn();
+ try{
+ play_ai_turn();
+ } catch(end_turn_exception& end_turn) {
+ if (end_turn.redo == team_index) {
+ player_type_changed_ = true;
+ }
+ }
} else if(current_team().is_network()) {
play_network_turn();
}
Modified: trunk/src/playsingle_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playsingle_controller.cpp?rev=30060&r1=30059&r2=30060&view=diff
==============================================================================
--- trunk/src/playsingle_controller.cpp (original)
+++ trunk/src/playsingle_controller.cpp Sat Oct 11 22:22:18 2008
@@ -616,6 +616,10 @@
//give control to human for the rest of this
turn
player_type_changed_ = true;
temporary_human = true;
+ } catch(end_turn_exception& end_turn) {
+ if (end_turn.redo == team_index) {
+ player_type_changed_ = true;
+ }
}
}
} while (player_type_changed_);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits