Skip to content

Remove unused forces#35

Open
BurninSun wants to merge 1 commit into
Wiwiweb:mainfrom
BurninSun:main
Open

Remove unused forces#35
BurninSun wants to merge 1 commit into
Wiwiweb:mainfrom
BurninSun:main

Conversation

@BurninSun

Copy link
Copy Markdown

Noticed some UPS issues with milestones on a larger save. Looking into it, the cause is storage.forces containing entries without players doing multiple checks on flow statistics.

if storage.forces[force.name] == nil and next(force.players) ~= nil then -- Don't bother with forces without players

This line should ensure no forces without players are being added, however it appears the larger saves I was looking at had entries for forces such as "enemy" which should never be there. I assume those entries were from a previous version but I didn't go through the commit history to figure out how they got there. New games do not have these extra forces stored.

This PR just adds a migration to remove any existing forces without players. It does nothing to make sure that doesn't happen in the future but I don't see any reason it would.

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