Fixed timer end warning not to play in opponents turn (bug: #11517)

This commit is contained in:
Pauli Nieminen 2008-06-27 16:33:52 +00:00
parent 830ce474ea
commit 29a08c0bf4
4 changed files with 13 additions and 10 deletions

View file

@ -8,6 +8,7 @@ Version 1.5.1+svn:
development, no compatibility layer has been added.
* Added gui to choose where server binary is
* Added type-a-head search to file chooser dialog
* Fixed timer end warning not to play in opponents turn (bug: #11517)
* Added recursion preventarion to [kill] fire_event=yes [/kill]
Version 1.5.1:

View file

@ -14,7 +14,7 @@
experience=40
level=1
alignment=neutral
advanceto=Elvish Captain,Elvish Hero
advanceto=Elvish Captain,Elvish Hero,Non exists
cost=14
usage=fighter
description= _ "Elves are not warlike by nature, but in times of need, their natural grace and agility serve them well, as does their skillful craftsmanship. An elf can grasp the basics of swordsmanship and archery in an uncannily short time, and put them to effective use on the battlefield."

View file

@ -85,8 +85,6 @@ void playmp_controller::play_side(const unsigned int team_index, bool save){
if(current_team().is_human()) {
LOG_NG << "is human...\n";
// reset default state
beep_warning_time_ = 0;
try{
before_human_turn(save);
@ -148,6 +146,14 @@ void playmp_controller::process(events::pump_info &info) {
}
}
void playmp_controller::reset_countdown()
{
if (beep_warning_time_ < 0)
sound::stop_bell();
beep_warning_time_ = 0;
}
//check if it is time to start playing the timer warning
void playmp_controller::think_about_countdown(int ticks) {
if(ticks >= beep_warning_time_) {
@ -277,10 +283,7 @@ void playmp_controller::linger(upload_log& log)
}
//current_team().set_countdown_time(0);
//halt and cancel the countdown timer
if(beep_warning_time_ < 0) {
sound::stop_bell();
}
beep_warning_time_=-1;
reset_countdown();
set_end_scenario_button();
@ -412,9 +415,7 @@ void playmp_controller::finish_side_turn(){
turn_data_ = NULL;
//halt and cancel the countdown timer
if(beep_warning_time_ < 0) {
sound::stop_bell();
}
reset_countdown();
}
void playmp_controller::play_network_turn(){

View file

@ -39,6 +39,7 @@ public:
static void set_replay_last_turn(unsigned int turn);
bool counting_down();
void reset_countdown();
void think_about_countdown(int ticks);
void process(events::pump_info &info);
void linger(upload_log& log);