Implemented your comments.
Fieldaction and the AI already work correctly, because they use
if (player_->is_hostile(bld->owner())) …
to see whether the aggressor is hostile to a building´s owner, and is_hostile() is where I put the important logic.
The only change the AI might need is that I´m not sure how it will handle players in a different team whom it is forbidden to attack. But when I tested the 2nd frisian scenario with these changes, it behaved well.
Implemented your comments. ->is_hostile( bld->owner( ))) …
Fieldaction and the AI already work correctly, because they use
if (player_
to see whether the aggressor is hostile to a building´s owner, and is_hostile() is where I put the important logic.
The only change the AI might need is that I´m not sure how it will handle players in a different team whom it is forbidden to attack. But when I tested the 2nd frisian scenario with these changes, it behaved well.