Author: alink
Date: Tue May 1 03:21:13 2007
New Revision: 17222
URL: http://svn.gna.org/viewcvs/wesnoth?rev=17222&view=rev
Log:
Fix a nasty (and maybe old) bug which allow to "stack" starting positions, but
with incorrect display and save.
(needs 2 undo to revert an overwrite of starting positions, but I think it's
not a problem)
Modified:
trunk/src/editor/editor.cpp
Modified: trunk/src/editor/editor.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor/editor.cpp?rev=17222&r1=17221&r2=17222&view=diff
==============================================================================
--- trunk/src/editor/editor.cpp (original)
+++ trunk/src/editor/editor.cpp Tue May 1 03:21:13 2007
@@ -560,12 +560,16 @@
_("Which player should start here?"),
gui::OK_CANCEL, &players);
- if (res > 0) {
- set_starting_position(res, selected_hex_);
- } else if (res==0) {
+ if (res >= 0) {
+ // we erase previous starting position on this hex
+ // this will prevent to cause a "stack" of these
+ // TODO: only use 1 undo to revert it (instead of 2)
const int current_side = starting_side_at(map_, selected_hex_);
if (current_side != -1) {
set_starting_position(current_side,
gamemap::location());
+ }
+ if (res > 0) {
+ set_starting_position(res, selected_hex_);
}
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits