no longer allow undo if a traitless unit reveals fogged and/or shrouded terrain

(bug #9171, patch #739)
This commit is contained in:
Mark de Wever 2007-05-23 20:12:10 +00:00
parent bdda277361
commit 3cb1621dce
3 changed files with 14 additions and 6 deletions

View file

@ -92,6 +92,8 @@ Version 1.3.2+svn:
* fixed bug 8522. Units without a name will be named after the unit_type.
* fixed bug #9103 (AI causes crash when using static units like towers)
* fixed a crash if a units poison attack has a cth of 0 (bug #9020)
* no longer allow undo if a traitless unit reveals fogged and/or shrouded
terrain (bug #9171, patch #739)
Version 1.3.2:
* campaigns

View file

@ -50,7 +50,8 @@ Version 1.3.2+svn:
* Savegames from Wesnoth 1.2.x are no longer compatible and thus cannot be
loaded.
* Fixed a crash when an invalid scenario was loaded (bug #9049).
* Fixed a bug which allowed undo after a recruit of a traitless unit
revealed fogged or shrouded map areas.
Version 1.3.2:
* Campaigns

View file

@ -781,13 +781,14 @@ namespace events{
redo_stack_.clear();
wassert(new_unit.type());
if(new_unit.type()->genders().size() > 1 || new_unit.type()->has_random_traits()) {
const bool shroud_cleared = clear_shroud(team_num);
if(shroud_cleared || new_unit.type()->genders().size() > 1 || new_unit.type()->has_random_traits()) {
clear_undo_stack(team_num);
} else {
undo_stack_.push_back(undo_action(new_unit,loc,RECRUIT_POS));
}
clear_shroud(team_num);
gui_->recalculate_minimap();
gui_->invalidate_game_status();
@ -902,10 +903,14 @@ namespace events{
statistics::recall_unit(un);
current_team.spend_gold(game_config::recall_cost);
undo_stack_.push_back(undo_action(un,loc,res));
redo_stack_.clear();
const bool shroud_cleared = clear_shroud(team_num);
if (shroud_cleared) {
clear_undo_stack(team_num);
} else {
undo_stack_.push_back(undo_action(un,loc,res));
}
clear_shroud(team_num);
redo_stack_.clear();
recall_list.erase(recall_list.begin()+res);
gui_->invalidate_game_status();