Applied patch from Silene which deals with several warnings (patch #3318)

This commit is contained in:
Isaac Clerencia Perez 2004-08-29 11:12:20 +00:00
parent 85ed245298
commit 2b18748bb2
9 changed files with 8 additions and 16 deletions

View file

@ -228,7 +228,6 @@ gamemap::location ai_interface::move_unit(location from, location to, std::map<l
const std::map<location,paths>::iterator p_it = possible_moves.find(from);
bool ambushed = false;
if(p_it != possible_moves.end()) {
paths& p = p_it->second;
std::map<location,paths::route>::iterator rt = p.routes.begin();
@ -316,7 +315,6 @@ bool ai::multistep_move_possible(location from, location to, location via, std::
std::cerr << "found leader moves..\n";
bool can_make_it = false;
int move_left = 0;
//see if the unit can make it to 'via', and if it can, how much movement it will have
@ -607,8 +605,6 @@ void ai::do_move()
remove_unit_from_moves(leader->first,srcdst,dstsrc);
}
int ticks = SDL_GetTicks();
std::vector<attack_analysis> analysis;
AI_DIAGNOSTIC("combat phase");
@ -738,9 +734,6 @@ bool ai::do_combat(std::map<gamemap::location,paths>& possible_moves, const move
const unit_map::const_iterator tgt = units_.find(target_loc);
const bool defender_human = (tgt != units_.end()) ?
teams_[tgt->second.side()-1].is_human() : false;
const location arrived_at = move_unit(from,to,possible_moves);
if(arrived_at != to) {
std::cerr << "unit moving to attack has ended up unexpectedly at " << (arrived_at.x+1) << "," << (arrived_at.y+1) << " when moving to "

View file

@ -742,8 +742,7 @@ void config::read(const std::string& data,
//all the last values get concatenated onto the last name
if(vars.empty() == false) {
for(size_t n = 0; n != maximum<size_t>(vars.size(),values.size()); ++n) {
const std::string& varname = n < vars.size() ? vars[n] : vars.back();
std::string value = "";
std::string value;
if(n < values.size()) {
value = values[n];
} else if(values.empty() == false) {

View file

@ -33,7 +33,6 @@ void map_labels::read(const config& cfg)
const config::child_list& items = cfg.get_children("label");
for(config::child_list::const_iterator i = items.begin(); i != items.end(); ++i) {
const gamemap::location loc(**i);
const std::string& id = (**i)["id"];
const std::string& text = (**i)["text"];
set_label(loc,text);
}

View file

@ -64,7 +64,9 @@ void receive_gamelist(display& disp, config& data)
class wait_for_start : public lobby::dialog
{
public:
wait_for_start(display& disp, config& cfg, int team_num, const std::string& team_name) : got_side(false), team(team_num), name(team_name), status(START_GAME), disp_(disp), cancel_button_(NULL), sides_(cfg), menu_(NULL)
wait_for_start(display& disp, config& cfg, int team_num, const std::string& team_name)
: got_side(false), team(team_num), name(team_name), status(START_GAME), disp_(disp),
sides_(cfg), cancel_button_(NULL), menu_(NULL)
{
SDL_Rect empty_rect = {0,0,0,0};
area_ = empty_rect;

View file

@ -19,6 +19,7 @@ public:
virtual RESULT process() = 0;
virtual bool manages_network() const { return false; }
virtual bool get_network_data(config& out) { return false; }
virtual ~dialog() {}
};
///function which controls the lobby, and will result in the player creating

View file

@ -65,7 +65,6 @@ team::team_info::team_info(const config& cfg)
team_name = cfg["team_name"];
if(team_name.empty())
team_name = cfg["side"];
const std::string& side_colour = cfg["colour"];
colour = lexical_cast_default<int>(cfg["colour"],-1);
if(colour == -1)
colour = lexical_cast_default<int>(cfg["side"],-1);

View file

@ -227,9 +227,6 @@ TITLE_RESULT show_title(display& screen, int* ntip)
std::cerr << "entering interactive loop...\n";
for(;;) {
int mousex, mousey;
const int mouse_flags = SDL_GetMouseState(&mousex,&mousey);
for(size_t b = 0; b != buttons.size(); ++b) {
if(buttons[b].pressed()) {
return TITLE_RESULT(b);

View file

@ -882,7 +882,7 @@ void unit::set_defending(bool newval, bool hits, int ms, attack_type::RANGE rang
state_ = newval ? (range == attack_type::LONG_RANGE ? STATE_DEFENDING_LONG :
STATE_DEFENDING_SHORT): STATE_NORMAL;
// attackingMilliseconds_ = ms;
const unit_animation* const anim = type_->defend_animation(getsHit_,range);
type_->defend_animation(getsHit_,range);
getsHit_ = hits;
}

View file

@ -356,6 +356,8 @@ void menu::key_press(SDLKey key)
case SDLK_PAGEDOWN:
move_selection_down(max_items_onscreen());
break;
default:
break;
}
}