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.
-- 
https://code.launchpad.net/~widelands-dev/widelands/peaceful/+merge/365273
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/peaceful into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to