Skip to content

Fix #321 : Fix exceptions when calling EnumExtensions.displayDescription()#322

Merged
gotmachine merged 2 commits into
devfrom
FastAndFixedEnumExtensions
Aug 28, 2025
Merged

Fix #321 : Fix exceptions when calling EnumExtensions.displayDescription()#322
gotmachine merged 2 commits into
devfrom
FastAndFixedEnumExtensions

Conversation

@gotmachine
Copy link
Copy Markdown
Contributor

Fix exceptions when calling EnumExtensions.displayDescription() with an enum value that isn't defined, a stock bug occuring more consistently when the KSPCF KSPFieldEnumDesc patch is enabled. As part of this new FastAndFixedEnumExtensions patch, also implement a cache for the enum descriptions.

…layDescription()` whith an enum value that isn't defined, a stock bug occuring more consistently when the KSPCF KSPFieldEnumDesc patch is enabled. As part of this new FastAndFixedEnumExtensions patch, also implement a cache for the enum descriptions.
@siimav
Copy link
Copy Markdown
Contributor

siimav commented Jun 14, 2025

I'm not sure it makes sense to have 2 separate toogleable patches for enum descriptions. I don't see anyone wanting to use one without the other. Besides that, looks like RA is the only KSPFieldEnumDesc user currently.

@gotmachine
Copy link
Copy Markdown
Contributor Author

The KSPFieldEnumDesc patch is a modding API optional patch extending a stock feature to PAW items, while this new FastAndFixedEnumExtensions patch is an enabled by default bugfix and performance patch for that base stock feature, so it will benefit to everyone and not just RA users. Admittedly, the feature isn't widely used in the stock codebase.

Do note that KSPFieldEnumDesc is hardwired to use the FastAndFixedEnumExtensions methods, so disabling the latter while enabling the former would still fix the original problem.

@gotmachine gotmachine merged commit cd12c35 into dev Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants