[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-12 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/ai_portspaces into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-12 Thread GunChleoc
Thanks for cleaning up :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-07 Thread TiborB
I believed the name is the person who should improve the code in the future.

it is removed now :)
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-07 Thread GunChleoc
Yep :)

No need for the extra ? though, it's supposed to be TODO(tiborb):

The reason for the username is that we will know who created the comment, in 
case somebody else will want to fix it later and has a question about the 
comment.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-03 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3133. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/337039757.
Appveyor build 2940. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_portspaces-2940.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-03 Thread TiborB
The proposal to merge lp:~widelands-dev/widelands/ai_portspaces into 
lp:widelands has been updated.

Commit Message changed to:

AI now scans entire map for portspaces. And multiple changes to the logic, 
including logic of placing militarysites in vicinity of port spaces.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-03 Thread TiborB
Should be OK now... we will see

-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-03 Thread GunChleoc
That's because CodeCheck is failing, as you can see from the Travis logs:

+grep '^[/_.a-zA-Z]\+:[0-9]\+:' codecheck.out
/home/travis/build/widelands/widelands/src/ai/defaultai.cc:990: Use 
"TODO(username): ".
+echo 'You have codecheck warnings (see above) Please fix.'
You have codecheck warnings (see above) Please fix.
+exit 1
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-02-02 Thread TiborB
@Gun, this is still not merged
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-31 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 3117. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/335329642.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-31 Thread GunChleoc
Review: Approve

The new AppVeor build worked :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-30 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3117. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/335329642.
Appveyor build 2924. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_portspaces-2924.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-30 Thread TiborB
trunk merged, not tested, but there were no conflicts
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-30 Thread GunChleoc
I tried the 32 bit version now, no joy.

Can you merge trunk again to trigger a new AppVeyor build? Maybe that will help.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-29 Thread GunChleoc
I'm having trouble downloading the AppVeyor build where I am, so somebody else 
will need to test this.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-28 Thread TiborB
OK, I need this (and the other AI branch) so I can resume AI training...

Two considerations:
1.) Some training is still needed to settle the changes
2.) The main problem here is road building, AI tend to build a road over free 
space and is insensitive about what fields it is crossing. I was considering 
some changes to the logic of placing the road (for AI), perhaps I will prepare 
some changes in this regard in the future...
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-26 Thread GunChleoc
Sure, no problem.

This still needs some testing, I might get around to it next week.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
ad 1) OK, I will consider better one

ad 2) I did not know it, I will be more careful next time
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
If you can't think of a better variable name, we can leave it, although it 
sounds a bit strange.

bunnybot will also run clang-format on each merge to trunk, so there will be 
differences.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
as for clang-format: if I run clang-format over defaultai.cc and merge to 
trunk, and re-run it 2 months later, there should not be such differences I 
believe. Both clang-formats are run on the same machine...
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
as for unowned_portspace_vicinity_nearby: some fields are restricted, listed in 
ports_vicinity, but here we dont talk about this, but about normal (allowed) 
buildable fields, and this is count of such "vicinity fields", so this is 
something like second / outer circle of fields around ports...

-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
clang-format results are somewhat system-dependent, so results can differ from 
what bunnybot will produce. So, you will probably get the same differences the 
next time.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
Those differences came to exist due to clang-format, and I dont understand why 
they are there Does rules for clang-format changes over time? but at least 
next time I will run clang-format there should not be such differences anymore.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
Review: Approve

Code LGTM, just a few tiny nits. Not tested.

There were a lot of entries in the diff that don't contain any code changes at 
all - please use a merge tool like Meld to compare to trunk the next time this 
happens. This will save the reviewer a lot of time.

Diff comments:

> === modified file 'src/ai/ai_help_structs.cc'
> --- src/ai/ai_help_structs.cc 2017-11-24 09:19:52 +
> +++ src/ai/ai_help_structs.cc 2018-01-06 19:40:55 +
> @@ -236,6 +236,7 @@
>   unowned_land_nearby(0),
>   enemy_owned_land_nearby(0U),
>   unowned_buildable_spots_nearby(0U),
> + unowned_portspace_vicinity_nearby(0U),

"vicinity" means the same as "nearby", so you can just drop it from the 
variable name.

>   nearest_buildable_spot_nearby(0U),
>   near_border(false),
>   unowned_mines_spots_nearby(0),
> 
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc   2017-12-10 21:19:02 +
> +++ src/ai/defaultai.cc   2018-01-06 19:40:55 +
> @@ -997,6 +979,19 @@
>   }
>   }
>  
> + // getting list of all fields nearby port space
> + // TODO it seems port spaces can change over time so ports_vicinity 
> needs to be refreshed from

TODO(tiborb):

> + // time to time
> + for (const Coords& c : map.get_port_spaces()) {
> + MapRegion mr(map, 
> Area(map.get_fcoords(c), 3));
> + do {
> + const uint32_t hash = mr.location().hash();
> + if (!ports_vicinity.count(hash)) {
> + ports_vicinity.insert(hash);
> + }
> + } while (mr.advance(map));
> + }
> +
>   // printing identified basic buildings if we are in the basic economy 
> mode
>   basic_economy_established = 
> persistent_data->remaining_basic_buildings.empty();
>   if (!basic_economy_established) {
> @@ -2454,10 +2436,21 @@
>  
>   int32_t prio = 0;  // score of a bulding on a field
>  
> + // testing for reserved ports
> + if (!bo.is(BuildingAttribute::kPort)) {
> + if (bf->portspace_nearby == 
> ExtendedBool::kTrue) {
> + if (num_ports == 0) {
> + continue;
> + }
> + // If we have at least on port, we can 
> perhaps build here something

on -> one  build something here

> + // but decreasing the score to 
> discourage it
> + prio -= 5 * 
> std::abs(management_data.get_military_number_at(52));
> + }
> + }
> +
>   if (bo.type == BuildingObserver::Type::kProductionsite) 
> {
>  
> - prio = 
> management_data.neuron_pool[44].get_result_safe(bf->military_score_ / 20) / 5;
> - assert(prio >= -20 && prio <= 20);
> + prio += 
> management_data.neuron_pool[44].get_result_safe(bf->military_score_ / 20) / 5;
>  
>   // this can be only a well (as by now)
>   if (bo.is(BuildingAttribute::kWell)) {


-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-06 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3036. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/325873487.
Appveyor build 2844. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_portspaces-2844.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_portspaces 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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-05 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3031. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/325644451.
Appveyor build 2839. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_portspaces-2839.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_portspaces 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


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-05 Thread TiborB
TiborB has proposed merging lp:~widelands-dev/widelands/ai_portspaces into 
lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785

AI now scans entire map for portspaces. And multiple changes to the logic, 
including logic of placing militarysites - they now know there is (unowned) 
vicinity of port spaces (or portspaces themselves)
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_portspaces into lp:widelands.
=== modified file 'src/ai/ai_help_structs.cc'
--- src/ai/ai_help_structs.cc	2017-11-24 09:19:52 +
+++ src/ai/ai_help_structs.cc	2018-01-05 22:15:52 +
@@ -236,6 +236,7 @@
  unowned_land_nearby(0),
  enemy_owned_land_nearby(0U),
  unowned_buildable_spots_nearby(0U),
+ unowned_portspace_vicinity_nearby(0U),
  nearest_buildable_spot_nearby(0U),
  near_border(false),
  unowned_mines_spots_nearby(0),

=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h	2017-11-17 07:16:12 +
+++ src/ai/ai_help_structs.h	2018-01-05 22:15:52 +
@@ -316,6 +316,7 @@
 	uint16_t unowned_land_nearby;
 	uint16_t enemy_owned_land_nearby;
 	uint16_t unowned_buildable_spots_nearby;
+	uint16_t unowned_portspace_vicinity_nearby;
 	uint16_t nearest_buildable_spot_nearby;
 	// to identify that field is too close to border and no production building should be built there
 	bool near_border;
@@ -356,7 +357,7 @@
 	Widelands::ExtendedBool is_portspace;
 	bool port_nearby;  // to increase priority if a port is nearby,
 	// especially for new colonies
-	Widelands::ExtendedBool portspace_nearby;  // prefer military buildings closer to the portspace
+	Widelands::ExtendedBool portspace_nearby;  // special fields intended for ports
 	int32_t max_buildcap_nearby;
 	// It is not necessary to check resources (stones, fish...) too frequently as they do not change
 	// fast. This stores the time of the last check.

=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc	2017-12-10 21:19:02 +
+++ src/ai/defaultai.cc	2018-01-05 22:15:52 +
@@ -123,7 +123,7 @@
 		   if (note.ownership == NoteFieldPossession::Ownership::GAINED) {
 			   unusable_fields.push_back(note.fc);
 		   }
-		});
+	   });
 
 	// Subscribe to NoteImmovables.
 	immovable_subscriber_ =
@@ -139,7 +139,7 @@
 		   } else {
 			   lose_immovable(*note.pi);
 		   }
-		});
+	   });
 
 	// Subscribe to ProductionSiteOutOfResources.
 	outofresource_subscriber_ = Notifications::subscribe(
@@ -150,7 +150,7 @@
 
 		   out_of_resources_site(*note.ps);
 
-		});
+	   });
 
 	// Subscribe to TrainingSiteSoldierTrained.
 	soldiertrained_subscriber_ = Notifications::subscribe(
@@ -161,46 +161,48 @@
 
 		   soldier_trained(*note.ts);
 
-		});
+	   });
 
 	// Subscribe to ShipNotes.
-	shipnotes_subscriber_ = Notifications::subscribe([this](
-	   const NoteShipMessage& note) {
-
-		// in a short time between start and late_initialization the player
-		// can get notes that can not be processed.
-		// It seems that this causes no problem, at least no substantial
-		if (player_ == nullptr) {
-			return;
-		}
-		if (note.ship->get_owner()->player_number() != player_->player_number()) {
-			return;
-		}
-
-		switch (note.message) {
-
-		case NoteShipMessage::Message::kGained:
-			gain_ship(*note.ship, NewShip::kBuilt);
-			break;
-
-		case NoteShipMessage::Message::kLost:
-			for (std::deque::iterator i = allships.begin(); i != allships.end(); ++i) {
-if (i->ship == note.ship) {
-	allships.erase(i);
-	break;
-}
-			}
-			break;
-
-		case NoteShipMessage::Message::kWaitingForCommand:
-			for (std::deque::iterator i = allships.begin(); i != allships.end(); ++i) {
-if (i->ship == note.ship) {
-	i->waiting_for_command_ = true;
-	break;
-}
-			}
-		}
-	});
+	shipnotes_subscriber_ =
+	   Notifications::subscribe([this](const NoteShipMessage& note) {
+
+		   // in a short time between start and late_initialization the player
+		   // can get notes that can not be processed.
+		   // It seems that this causes no problem, at least no substantial
+		   if (player_ == nullptr) {
+			   return;
+		   }
+		   if (note.ship->get_owner()->player_number() != player_->player_number()) {
+			   return;
+		   }
+
+		   switch (note.message) {
+
+		   case NoteShipMessage::Message::kGained:
+			   gain_ship(*note.ship, NewShip::kBuilt);
+			   break;
+
+		   case NoteShipMessage::Message::kLost:
+			   for (std::deque::iterator i = allships.begin(); i != allships.end();
+			++i) {
+   if (i->ship == note.ship) {
+	   allships.erase(i);
+	   break;
+   }
+			   }
+			   break;
+
+		   case NoteShipMessage::Message::kWaitingForCommand:
+			   for (std::deque::iterator i = allships.begin(); i != allships.end();
+			++i) {
+   if (i->ship == note.ship)