ClanGenOfficial / clangen

Warrior Cats fan game
https://clangen.io
Other
251 stars 450 forks source link

[BUG] History crash #2591

Closed LaurelWillow closed 1 month ago

LaurelWillow commented 2 months ago

Type: (only select one)

Describe the bug One of my cats just really likes to crash the game when I try to look at his history. I've crashed my game like seven times trying to figure out what exactly is going on. I originally thought it was crashing because he died saving a cat who has now faded. However, on a different clan, save file editing in the same death and fading a cat, it didn't crash, so now I'm not sure.

Grade:

Reproduce I don't actually know. If I definitively figure out what's causing this, I'll update this section to reflect that.

Commit # or Game Version Number: cfcf13b8

Additional context This was originally reported by ServalBones on discord, who had a similar crash specifically when turning on the "view moon" setting in a murdered cat's history. While trying to reproduce it, I got this crash, which I think is slightly different but I'm not completely sure.

Screenshots crasher of games:

Screenshot 2024-07-27 at 12 00 16 AM

crasher of games' history file:

Screenshot 2024-07-27 at 12 05 50 AM

crash log:

Screenshot 2024-07-27 at 12 06 30 AM

ServalBones' original bug report:

Screenshot 2024-07-28 at 4 09 18 PM

History file from that cat:

Screenshot 2024-07-28 at 4 10 26 PM Screenshot 2024-07-28 at 4 10 51 PM

crash log:

Screenshot 2024-07-28 at 4 11 28 PM
PoppyBlossom commented 1 month ago

Thank you for opening this issue. From the crash log you provided it seems like it's trying to get the r_c(random cat)'s pronoun but failed, I assume the choice function received null which caused the crash. I'm going to try recreating the crash.

PoppyBlossom commented 1 month ago

In cfcf13b when a cat fades it sets its pronoun to an empty array (script/cat/cats.py line 371) which explains the 'cannot choose from an empty sequence' part of the crash log.

ZtheCorgi commented 1 month ago

none pronouns with left crash....

PoppyBlossom commented 1 month ago

Here's a breakdown of the problem

  1. cat faded, script/game_structrue, line 476 creates a simplified version of the cat's info, which has an empty array for pronouns
  2. trying to read the faded cat's pronoun information using the function choice in script/utility, line 2005, which resulted in a crash.

possible fix: there is no simple way around this unless changing the way the faded cat's info is preserved. Or we can use gender-neutral pronouns, it's better than crashing.

PoppyBlossom commented 1 month ago

I managed to replicate this crash. Follow these steps: Find a cat and modify the "die_by, text" in its history file to something like "m_c died of old age because of r_c." Make sure to specify an ID of a faded cat from the "faded_cats" folder in the "involve" field. After making these changes, run the game and check the cat's history. The game will crash as a result. image

PoppyBlossom commented 1 month ago

@LaurelWillow thank you for the infomations! If you don't mind you can make ServalBones's bug report a separate issue since they are quite different.

LaurelWillow commented 1 month ago

Yup I can do that! Thankful my guy Fincrest will no longer be a gamebreak hazard 👍