ZAB909 / ChapterMaster

13 stars 21 forks source link

Refactor star names handling #204

Closed GalacticChimp closed 8 months ago

GalacticChimp commented 10 months ago

Description: Currently star names are handled by scr_star_name, however there's an issue with custom chapters, which fetch recruitment world names from the list. This sometimes results in duplicates which breaks the game, since stuff is mostly identified by it's name currently.

Proposed fix: Refactor scr_star_name to use a hashset/dictionary/whatever internally, which will allow us to track which names are in use and which not. This will also prevent initialiazing the game with duplicate star names, since the new data structure will throw an error immediately upon receiving a duplicate.

After that, recheck Chapter creation/initialization code to make sure everything will be fine.