Skip to content

Tile improvement fix#912

Merged
stavrosfa merged 1 commit intoC7-Game:Developmentfrom
stavrosfa:fix/tile-overlay
Mar 8, 2026
Merged

Tile improvement fix#912
stavrosfa merged 1 commit intoC7-Game:Developmentfrom
stavrosfa:fix/tile-overlay

Conversation

@stavrosfa
Copy link
Contributor

I had some issues when trying to load a json save where some tiles had railroads. As far as I can tell, this happens, because when we save the overlays, if there is a railroad, we don't save the road that invisibly exists underneath it.

So then, when loading, we try to add railroad to a tile that doesn't seem to have a road.

This does not happen with .biq and .sav files because when debugging I saw that we import both a road and a railroad overlay when laoding the tile info

So now, the only place where we check if we can add an improvement, is during gameplay and not when loading a save. I think it also makes sense from a cleaner code standpoint, to have a dedicated method to add an improvement, rather than also checking if we can add it in the same method.

I don't think that we need to imitate what the .biq and .sav files do and save both improvements, as we can upgrade and downgrade on the fly.

Copy link
Contributor

@ajhalme ajhalme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@stavrosfa stavrosfa merged commit 775869f into C7-Game:Development Mar 8, 2026
3 checks passed
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.

2 participants