Merge branch 'tormod/castles-avoid-trees' into 'master'

Make castles avoid trees.

See merge request veloren/veloren!3799
This commit is contained in:
Isse 2023-02-21 13:05:16 +00:00
commit 9b6dd6198b

View File

@ -1180,10 +1180,12 @@ impl Civs {
fn castle_enemies(&self) -> Vec<Vec2<i32>> {
self.sites()
.filter_map(|s| match s.kind {
SiteKind::Tree | SiteKind::GiantTree => None,
_ if s.is_settlement() => None,
_ => Some(s.center),
.filter_map(|s| {
if s.is_settlement() {
None
} else {
Some(s.center)
}
})
.collect()
}