mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 08:16:24 +00:00
Don't invalidate villages for flag animations, unless they are owned.
This commit is contained in:
parent
b7cddaea47
commit
5c1d673a18
@ -2054,7 +2054,7 @@ void display::invalidate_animations()
|
||||
for(int x = topleft.x; x <= bottomright.x; ++x) {
|
||||
for(int y = topleft.y; y <= bottomright.y; ++y) {
|
||||
gamemap::location loc(x,y);
|
||||
if(builder_.update_animation(loc) || (map_.is_village(loc) && animate_flags)) {
|
||||
if(builder_.update_animation(loc) || (map_.is_village(loc) && animate_flags && player_teams::village_owner(loc) != -1)) {
|
||||
invalidate(loc);
|
||||
}
|
||||
}
|
||||
|
15
src/team.cpp
15
src/team.cpp
@ -986,3 +986,18 @@ void team::log_recruitable(){
|
||||
}
|
||||
LOG_NG << "Added all recruitable units\n";
|
||||
}
|
||||
|
||||
namespace player_teams {
|
||||
int village_owner(const gamemap::location& loc)
|
||||
{
|
||||
if(! teams) {
|
||||
return -1;
|
||||
}
|
||||
for(size_t i = 0; i != teams->size(); ++i) {
|
||||
if((*teams)[i].owns_village(loc))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,6 +276,10 @@ struct teams_manager {
|
||||
bool is_observer();
|
||||
};
|
||||
|
||||
namespace player_teams {
|
||||
int village_owner(const gamemap::location& loc);
|
||||
}
|
||||
|
||||
bool is_observer();
|
||||
|
||||
//function which will validate a side. Trows game::game_error
|
||||
|
Loading…
x
Reference in New Issue
Block a user