fixed weapon_specials filter_opponent to work in attack selection (bug #8333)

Made quick replay skip messages
This commit is contained in:
Pauli Nieminen 2008-01-19 17:48:26 +00:00
parent 18cc2ce38e
commit f89e35275c
8 changed files with 16 additions and 7 deletions

View file

@ -11,6 +11,7 @@ Version 1.3.14+svn:
(bug #9538)
* user interface:
* Made ESC clear hotkey when changing hotkeys
* Made quick replay skip messages
* linger mode overlay is also drawn over fog and shroud (bug #10811)
* miscellaneous and bug fixes:
* Fixed boost test compile with 1.34.1
@ -20,6 +21,7 @@ Version 1.3.14+svn:
usefull
* converted NO_MAP_DATA to new map format
* fixed unchecked vector access
* fixed weapon_specials filter_opponent to work in attack selection (bug #8333)
* added a more graceful handling of maps without a header (bug #10787)
* make sure the python campaign client list shows a space between the
headers if the size of the column is smaller than the header (eg uploads)

View file

@ -9,6 +9,7 @@ Version 1.3.14+svn:
* User interface
* Made ESC clear hotkey when changing hotkeys.
* Made quick replay skip messages
* Linger mode overlay is also drawn over fog and shroud.
* Miscellaneous and bug fixes

View file

@ -1848,7 +1848,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
// and there is no input to be made, show the dialog.
if(get_replay_source().at_end() || (options.empty() && !has_text_input) ) {
if (side_for_show)
if (side_for_show && !get_replay_source().is_skipping())
{
const t_string msg = cfg["message"];
const std::string duration_str = cfg["duration"];

View file

@ -219,7 +219,7 @@ Units cannot be killed by poison alone. The poison will not reduce it below 1 HP
std::vector<attack_type>& attacks = u->second.attacks();
for(std::vector<attack_type>::iterator at_it = attacks.begin();
at_it != attacks.end(); ++at_it) {
at_it->set_specials_context(u->first,u->second);
at_it->set_specials_context(u->first,gamemap::location(),u->second);
const std::string& lang_type = gettext(at_it->type().c_str());
str.str("");
str << "<245,230,193>";

View file

@ -1333,6 +1333,9 @@ bool mouse_handler::attack_enemy_(unit_map::iterator attacker, unit_map::iterato
const attack_type& attw = attack_type(*att.weapon);
const attack_type& defw = attack_type(def.weapon ? *def.weapon : no_weapon);
attw.set_specials_context(attacker->first, defender->first, attacker->second, true);
defw.set_specials_context(attacker->first, defender->first, attacker->second, false);
//if there is an attack special or defend special, we output a single space for the other unit, to make sure
//that the attacks line up nicely.
std::string special_pad = "";

View file

@ -370,7 +370,7 @@ private:
config modifications_;
friend void attack_type::set_specials_context(const gamemap::location& loc,const unit& un) const;
friend void attack_type::set_specials_context(const gamemap::location& loc, const gamemap::location&, const unit& un, bool) const;
const game_data* gamedata_;
const unit_map* units_;
const gamemap* map_;

View file

@ -25,6 +25,8 @@
#include <cassert>
#define LOG_NG LOG_STREAM(info, engine)
/*
*
* [abilities]
@ -595,6 +597,7 @@ std::string attack_type::weapon_specials(bool force) const
char const *s = (force || special_active(**j, true, true))
? "name" : "name_inactive";
std::string const &name = (**j)[s];
if (!name.empty()) {
if (!res.empty()) res += ',';
res += name;
@ -810,16 +813,16 @@ void attack_type::set_specials_context(const gamemap::location& aloc,const gamem
other_attack_ = other_attack;
}
void attack_type::set_specials_context(const gamemap::location& loc,const unit& un) const
void attack_type::set_specials_context(const gamemap::location& loc, const gamemap::location& dloc, const unit& un, bool attacker) const
{
aloc_ = loc;
dloc_ = gamemap::location();
dloc_ = dloc;
gamedata_ = un.gamedata_;
unitmap_ = un.units_;
map_ = un.map_;
game_status_ = un.gamestatus_;
teams_ = un.teams_;
attacker_ = true;
attacker_ = attacker;
other_attack_ = NULL;
}

View file

@ -56,7 +56,7 @@ public:
const game_data* gamedata, const unit_map* unitmap,
const gamemap* map, const gamestatus* game_status,
const std::vector<team>* teams,bool attacker,const attack_type* other_attack) const;
void set_specials_context(const gamemap::location& loc,const unit& un) const;
void set_specials_context(const gamemap::location& loc,const gamemap::location& dloc, const unit& un, bool attacker =true) const;
bool has_special_by_id(const std::string& special) const;
//this function returns a random animation out of the possible