Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make building replacements compatible with RMB replacements #2699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drcarademono
Copy link
Contributor

Currently modded building replacements and modded RMB replacements are incompatible. Whenever a mod tries to change a building in a modded RMB, the building's metadata is changed but the exterior and interior remains unchanged. This is an especially big problem for unmaintained building replacement mods like Tavern's Redone and Soldier's Luxury, which are incompatible with newer RMB replacement mods like Cities Overhauled and Beautiful Cities.

This PR fixes these incompatibilities by applying building replacements in RMBLayout, after applying RMB replacements. It modifies the method GetLocationBuildingData, in which building replacements change metadata, so that it also changes RMBSubRecords.

Everything appears to be working as intended upon testing. Buildings are replaced in modded RMBs exactly as they would be were the building replacement affecting a vanilla block. Both interior and exterior data (as with Lively Cities) works correctly. Factions (like Archaeologists Guild) work correctly and appear in blue on the automap. Named buildings like taverns still get their metadata from the location data after the building replacements are applied, so their nameseeds and quality etc are correct. This PR also appears to be robust to modded RMBs with many buildings deleted (ie Beautiful Villages); no NullReferences or Index out of range occurred.

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