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

Does not add to Home region when deconstruct buildings; #205

Open
soulkata opened this issue Mar 29, 2024 · 0 comments
Open

Does not add to Home region when deconstruct buildings; #205

soulkata opened this issue Mar 29, 2024 · 0 comments

Comments

@soulkata
Copy link

I would like when deconstruct a building, it won't add home region around that building. To have same behaviour as normal deconstruct of mine...

I took the liberty of looking into code... On ManagerJob_Mining at line 669 there is:

if (building?.ClaimableBy(Faction.OfPlayer) ?? false) building.SetFaction(Faction.OfPlayer);

The SetFaction add the region to home area... if change to something like that:

if (building?.ClaimableBy(Faction.OfPlayer) ?? false)
{
bool originalValue = Find.PlaySettings.autoHomeArea;
try
{
Find.PlaySettings.autoHomeArea = false;
building.SetFaction(Faction.OfPlayer);
}
finally
{
Find.PlaySettings.autoHomeArea = originalValue;
}
}

It won't add to home area...

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

No branches or pull requests

1 participant