Fixed OoS bug when giving control and having move in undo stack.
This commit is contained in:
parent
30fb091b0b
commit
376e62bb95
3 changed files with 21 additions and 0 deletions
|
@ -44,6 +44,7 @@ Version 1.5.3+svn:
|
|||
* Made config cache code available to eveverywhere in wesnoth
|
||||
* Fixed [modify_turns] giving the unwanted side-effect of changing
|
||||
turn limit when only current= modifier was used.
|
||||
* Fixed OOS bug when giving control and having move in undo stack.
|
||||
* Fixed [modify_turns] not updating $turn_number when current= was
|
||||
used.
|
||||
* Fixed a few inconsistencies related to scenarios which are not at
|
||||
|
|
|
@ -23,6 +23,9 @@ Version 1.5.3:
|
|||
* Parts of the new widget libary are deemed stable enough for testing and
|
||||
have been started to replace the old code.
|
||||
|
||||
* Bug fixes:
|
||||
* Fixed OOS bug when giving control and having move in undo stack.
|
||||
|
||||
Version 1.5.3:
|
||||
* Campaigns
|
||||
* Descent into Darkness
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "sound.hpp"
|
||||
#include "upload_log.hpp"
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#define LOG_NG LOG_STREAM(info, engine)
|
||||
|
@ -186,6 +188,21 @@ void playmp_controller::play_human_turn(){
|
|||
try{
|
||||
if (turn_data_->process_network_data(cfg,res,backlog,skip_replay_) == turn_info::PROCESS_RESTART_TURN)
|
||||
{
|
||||
// Clean undo stack if turn has to be restarted (losing control)
|
||||
if (!undo_stack_.empty())
|
||||
{
|
||||
const std::string msg =_("Undoing moves not yet transmited to server.");
|
||||
const int size = 20;
|
||||
const int lifetime = 150;
|
||||
SDL_Color colour = {255,255,255,255};
|
||||
|
||||
SDL_Rect rect = gui_->map_area();
|
||||
font::add_floating_label(msg,size, colour,
|
||||
rect.w/2,rect.h/2,0.0,0.0,lifetime,rect,font::CENTER_ALIGN);
|
||||
}
|
||||
|
||||
while(!undo_stack_.empty())
|
||||
menu_handler_.undo(gui_->get_playing_team() + 1);
|
||||
throw end_turn_exception(gui_->get_playing_team() + 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue