fix the warnings introduced by version 2007-05-12T10:33:21Z!jeremy.rosen@enst-bretagne.fr.

This commit is contained in:
Patrick Parker 2007-05-20 03:23:24 +00:00
parent 835e64d9a2
commit 94922f1235
2 changed files with 5 additions and 6 deletions

View File

@ -294,8 +294,7 @@ bool ai_interface::recruit(const std::string& unit_name, location loc)
unit new_unit(&info_.gameinfo,&info_.units,&info_.map,&info_.state,&info_.teams,&u->second,info_.team_num,true);
//see if we can actually recruit (i.e. have enough room etc)
if(recruit_unit(info_.map,info_.team_num,info_.units,new_unit,loc,preferences::show_ai_moves() ?
&info_.disp : NULL).empty()) {
if(recruit_unit(info_.map,info_.team_num,info_.units,new_unit,loc,preferences::show_ai_moves()).empty()) {
statistics::recruit_unit(new_unit);
current_team().spend_gold(u->second.cost());

View File

@ -771,7 +771,7 @@ namespace events{
recorder.add_recruit(recruit_num, last_hex);
unit new_unit(&gameinfo_,&units_,&map_,&status_,&teams_,&(u_type->second),team_num,true);
gamemap::location loc = last_hex;
const std::string& msg = recruit_unit(map_,team_num,units_,new_unit,loc,gui_);
const std::string& msg = recruit_unit(map_,team_num,units_,new_unit,loc,(gui_!=NULL));
if(msg.empty()) {
current_team.spend_gold(u_type->second.cost());
statistics::recruit_unit(new_unit);
@ -894,7 +894,7 @@ namespace events{
gamemap::location loc = last_hex;
recorder.add_recall(res,loc);
un.set_game_context(&gameinfo_,&units_,&map_,&status_,&teams_);
const std::string err = recruit_unit(map_,team_num,units_,un,loc,gui_);
const std::string err = recruit_unit(map_,team_num,units_,un,loc,(gui_!=NULL));
if(!err.empty()) {
recorder.undo();
gui::show_dialog(*gui_,NULL,"",err,gui::OK_ONLY);
@ -1045,7 +1045,7 @@ namespace events{
recorder.add_recall(action.recall_pos,action.recall_loc);
un.set_game_context(&gameinfo_,&units_,&map_,&status_,&teams_);
const std::string& msg = recruit_unit(map_,team_num,units_,un,action.recall_loc,gui_);
const std::string& msg = recruit_unit(map_,team_num,units_,un,action.recall_loc,(gui_!=NULL));
if(msg.empty()) {
statistics::recall_unit(un);
teams_[team_num - 1].spend_gold(game_config::recall_cost);
@ -1083,7 +1083,7 @@ namespace events{
recorder.add_recruit(recruit_num,loc);
unit new_unit = action.affected_unit;
//unit new_unit(action.affected_unit.type(),team_num_,true);
const std::string& msg = recruit_unit(map_,team_num,units_,new_unit,loc,gui_);
const std::string& msg = recruit_unit(map_,team_num,units_,new_unit,loc,(gui_!=NULL));
if(msg.empty()) {
current_team.spend_gold(new_unit.type()->cost());
statistics::recruit_unit(new_unit);