Merge lp:~widelands-dev/widelands/immovable-grow-owner into lp:widelands

Proposed by Benedikt Straub
Status: Merged
Merged at revision: 8845
Proposed branch: lp:~widelands-dev/widelands/immovable-grow-owner
Merge into: lp:widelands
Diff against target: 15 lines (+2/-1)
1 file modified
src/logic/map_objects/immovable.cc (+2/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/immovable-grow-owner
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+355518@code.launchpad.net

Commit message

Keep an immovable's owner when growing, so tribe immovables don't lose their owner

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4015. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/431847963.
Appveyor build 3812. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_immovable_grow_owner-3812.

Revision history for this message
Benedikt Straub (nordfriese) wrote :

Travis fails because of codecheck errors that are already in trunk

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM, thanks for the fix :)

@bunnybot merge

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4022. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/432363063.
Appveyor build 3818. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_immovable_grow_owner-3818.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/logic/map_objects/immovable.cc'
2--- src/logic/map_objects/immovable.cc 2018-09-04 15:48:47 +0000
3+++ src/logic/map_objects/immovable.cc 2018-09-24 07:55:20 +0000
4@@ -928,9 +928,10 @@
5 if (logic_rand_as_double(&game) <
6 probability_to_grow(descr.terrain_affinity(), f, map, game.world().terrains())) {
7 MapObjectDescr::OwnerType owner_type = descr.owner_type();
8+ Player* owner = immovable.get_owner();
9 immovable.remove(game); // Now immovable is a dangling reference!
10 game.create_immovable_with_name(
11- f, type_name, owner_type, nullptr /* owner */, nullptr /* former_building_descr */);
12+ f, type_name, owner_type, owner, nullptr /* former_building_descr */);
13 } else {
14 immovable.program_step(game);
15 }

Subscribers

People subscribed via source and target branches

to status/vote changes: