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

Fix crash during call to CommonMonitor.SetCharacterSlot #9

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

tc21
Copy link
Collaborator

@tc21 tc21 commented Feb 8, 2024

Fixes a crash when loading the music selection screen, where the call to retrieve character data to display on top monitor causes a KeyNotFound error. This fix simply doesn't load those characters.

上面小屏幕里的加载不出来的人物会变成空白。但是至少不会崩了……

Comment on lines +35 to +41
if (!____characterSlotData.ContainsKey(data.MapKey))
{
Console.Log($"Could not get CharacterSlotData for character [Index={data.Index}, MapKey={data.MapKey}], ignoring...");
return false;
}

return true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

突然想到前几天看到的某条推

只要后来人把中间的这行log一删,就会变成有名的spaghetti code(

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quq

@hykilpikonna hykilpikonna merged commit e1180a9 into master Feb 8, 2024
1 of 2 checks passed
@hykilpikonna hykilpikonna deleted the tc21/fix-crash-slot-data-not-found branch February 8, 2024 04:19
clansty pushed a commit that referenced this pull request Dec 2, 2024
…found

Fix crash during call to CommonMonitor.SetCharacterSlot
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