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

Fixed a bug that caused an exception when changing clothes in KKS #12

Merged

Conversation

takahiro0327
Copy link
Contributor

Fixed a bug that caused an exception when performing certain operations when changing clothes in the KKS studio. Please merge if it is not a problem.

Reproduction procedure:

  1. launch Sunshine studio
  2. Load any character
  3. Open the Load Costume menu
  4. Click [Show Selection]
  5. Click on Switch Costumes

スクリーンショット 2023-12-01 221709

Log:

[Error  :Modding API] System.NullReferenceException: Object reference not set to an instance of an object
  at KK_SkinEffects.SkinEffectsController.ClearCharaState (System.Boolean refreshTextures, System.Boolean forceClothesStateUpdate) [0x00000] in <40cb824239fc4abd9826a3ab907c951c>:0 
  at KK_SkinEffects.SkinEffectsController.ApplyCharaState (System.Collections.Generic.IDictionary`2[TKey,TValue] dataDict, System.Boolean onlyCustomEffects) [0x00008] in <40cb824239fc4abd9826a3ab907c951c>:0 
  at KK_SkinEffects.SkinEffectsController.OnReload (KKAPI.GameMode currentGameMode, System.Boolean maintainState) [0x001dd] in <40cb824239fc4abd9826a3ab907c951c>:0 
  at KKAPI.Chara.CharaCustomFunctionController.OnReloadInternal (KKAPI.GameMode currentGameMode) [0x00038] in <19e1c278317b4a43a2b69f98f72c73c8>:0 

output_log.txt

Also, the method of getting _ksox in Awake() worked well. However, I thought it was not a good idea to write code in Awake that depends on the behavior of other components (calls to AddComponent), so I decided to set it up in Reload in a limited way.
It seems to be due to the [Coordinate Load Option] not being well behaved, but it seems that the source code is not available over there, so please allow me to fix it here.

@ManlyMarco ManlyMarco merged commit 78ad56a into ManlyMarco:master Dec 1, 2023
@takahiro0327
Copy link
Contributor Author

Thanks for merge.

@takahiro0327 takahiro0327 deleted the fixed_changing_clothes_exception branch December 25, 2023 03:10
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