fixed adjacent units to update if unit affects them
This commit is contained in:
parent
e6525e7437
commit
4be428b073
4 changed files with 19 additions and 0 deletions
|
@ -44,6 +44,7 @@ Version 1.3.14+svn:
|
|||
* Made unit to hideable by others units (bug #10877)
|
||||
* Make wesnoth work properly again if the datadir contains ../
|
||||
* Fixed some type of addon not being uninstallable (bug #10788)
|
||||
* fixed adjacent units to update if unit affects them
|
||||
* converted NO_MAP_DATA to new map format
|
||||
* fixed unchecked vector access
|
||||
* make sure the python campaign client list shows a space between the
|
||||
|
|
|
@ -1918,6 +1918,15 @@ std::set<gamemap::location> unit::overlaps(const gamemap::location &loc) const
|
|||
}
|
||||
}
|
||||
|
||||
if (abilities_affects_adjacent())
|
||||
{
|
||||
gamemap::location arr[6];
|
||||
get_adjacent_tiles(loc, arr);
|
||||
for (unsigned int i = 0; i < 6; i++) {
|
||||
over.insert(arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return over;
|
||||
}
|
||||
|
||||
|
|
|
@ -252,6 +252,7 @@ public:
|
|||
std::vector<std::string> ability_tooltips(const gamemap::location& loc) const;
|
||||
std::vector<std::string> unit_ability_tooltips() const;
|
||||
bool has_ability_type(const std::string& ability) const;
|
||||
bool abilities_affects_adjacent() const;
|
||||
|
||||
void reset_modifications();
|
||||
void backup_state();
|
||||
|
|
|
@ -195,6 +195,14 @@ unit_ability_list unit::get_abilities(const std::string& ability, const gamemap:
|
|||
return res;
|
||||
}
|
||||
|
||||
bool unit::abilities_affects_adjacent() const
|
||||
{
|
||||
if (cfg_.child("abilities")
|
||||
&& cfg_.child("abilities")->child("affects_adjacent"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> unit::unit_ability_tooltips() const
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
|
|
Loading…
Add table
Reference in a new issue