Hidden units are not displayed in the minimap (again *grin*)

This commit is contained in:
Isaac Clerencia Perez 2004-03-10 23:56:04 +00:00
parent 097978a9f2
commit 9ca6eb262a
3 changed files with 8 additions and 6 deletions

View file

@ -918,7 +918,10 @@ void display::draw_minimap(int x, int y, int w, int h)
SDL_BlitSurface(surface,NULL,video().getSurface(),&loc);
for(unit_map::const_iterator u = units_.begin(); u != units_.end(); ++u) {
if(fogged(u->first.x,u->first.y))
if(fogged(u->first.x,u->first.y) || u->second.invisible(
map_.underlying_terrain(map_[u->first.x][u->first.y]),
status_.get_time_of_day().lawful_bonus,u->first,
units_,teams_))
continue;
const int side = u->second.side();
@ -1670,7 +1673,7 @@ SDL_Surface* display::getMinimap(int w, int h)
std::cerr << "regetting minimap\n";
minimap_ = image::getMinimap(w,h,map_,
status_.get_time_of_day().lawful_bonus,
team_valid() ? &teams_[currentTeam_] : NULL, &units_, &teams_);
team_valid() ? &teams_[currentTeam_] : NULL);
std::cerr << "done regetting minimap\n";
}

View file

@ -224,8 +224,7 @@ SDL_Surface* get_image_dim(const std::string& filename, size_t x, size_t y)
}
SDL_Surface* getMinimap(int w, int h, const gamemap& map,
int lawful_bonus,
const team* tm, const unit_map* units, const std::vector<team>* teams)
int lawful_bonus, const team* tm)
{
SDL_Surface* minimap = NULL;
if(minimap == NULL) {
@ -300,4 +299,4 @@ SDL_Surface* getMinimap(int w, int h, const gamemap& map,
return minimap;
}
}
}

View file

@ -66,7 +66,7 @@ namespace image {
//the surface returned must be freed by the user
SDL_Surface* getMinimap(int w, int h, const gamemap& map_, int lawful_bonus,
const team* tm=NULL, const unit_map* units=NULL, const std::vector<team>* teams=NULL);
const team* tm=NULL);
}
#endif