Skip to content

Fix meadow loss when upgrading to land-consuming buildings#160

Open
wuyeyoumin wants to merge 1 commit intosoundmud:masterfrom
wuyeyoumin:fix-upgrade-meadow-loss
Open

Fix meadow loss when upgrading to land-consuming buildings#160
wuyeyoumin wants to merge 1 commit intosoundmud:masterfrom
wuyeyoumin:fix-upgrade-meadow-loss

Conversation

@wuyeyoumin
Copy link
Copy Markdown

Bug description

When a unit is upgraded into a building that consumes meadow land,
the meadow is removed from the world but not recorded in the new
building's building_land field.

As a result, when the upgraded building is destroyed, the meadow
cannot be restored and is permanently lost.

Fix

This PR preserves or assigns building_land during the upgrade
process so that buildings created via upgrade_to correctly restore
their meadow when destroyed.

The fix is consistent with the normal building construction logic and
does not affect buildings that do not consume meadow.
I encountered this issue during gameplay and verified that this change fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant