made it so that when a goto command is given, the unit is deselected.

Also made it so that villages owned by other sides that are in the fog
of war are displayed as neutral villages.
This commit is contained in:
Dave White 2003-11-19 21:26:42 +00:00
parent 8e9bbb4648
commit e298daa9d9
2 changed files with 7 additions and 6 deletions

View file

@ -1426,9 +1426,10 @@ SDL_Surface* display::getTerrain(gamemap::TERRAIN terrain,image::TYPE image_type
map_.get_terrain_info(terrain).default_image());
if(tower) {
size_t i;
for(i = 0; i != teams_.size(); ++i) {
if(teams_[i].owns_tower(gamemap::location(x,y))) {
if(teams_[i].owns_tower(gamemap::location(x,y)) && (!fogged(x,y) || i == currentTeam_)) {
char buf[50];
sprintf(buf,"-team%d",i+1);
image += buf;

View file

@ -491,13 +491,8 @@ void turn_info::left_click(const SDL_MouseButtonEvent& event)
current_route_.steps.front() == selected_hex_) {
const size_t moves = move_unit(&gui_,map_,units_,teams_,
current_route_.steps,&recorder,&undo_stack_);
if(moves == 0)
return;
redo_stack_.clear();
selected_hex_ = gamemap::location();
gui_.set_route(NULL);
@ -505,6 +500,11 @@ void turn_info::left_click(const SDL_MouseButtonEvent& event)
gui_.set_paths(NULL);
current_paths_ = paths();
if(moves == 0)
return;
redo_stack_.clear();
assert(moves <= current_route_.steps.size());
const gamemap::location& dst = current_route_.steps[moves-1];