Repository navigation
Fix bug where fishing with PlayerProjectile.enableScaleWithSkillLevel causes inability to save - #777
Closed
Grantapher wants to merge 1 commit into
Closed
Grantapher wants to merge 1 commit into
Grantapher wants to merge 1 commit into
Conversation
Open
healiha
approved these changes
Feb 9, 2023
healiha
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
Also, thanks for fixing this unsightly try/catch.
rozwel
approved these changes
Mar 23, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #758. I reproduced save not working before this change and working afterwards.
The issue is that
__instance.m_weapon.m_shared.m_skillTypeisNonefor the fishing rod. Casting the rod triggersProjectileAttackTriggered, which then callsplayer.m_skills.GetSkill(skillType)with askillTypeofNone. WhenGetSkilldoesn't find an existing skill forNone, it creates a new one forNonewith 0 xp and level as well as nullm_info. This is added to the list of skills to later be saved. WhenSkill.Saveis called there is a line of code which tries to readskill.m_info.m_skill, which causes theNullReferenceException, sinceskill.m_infoisnull.The fix ensures we skip calling
GetSkillwhenskillTypeisNone.I also added this check to the other place where
GetSkillis called, just in case.