CandyNim
Tiller
Bug: When an NPC states a dialogue containing [], it crashes.
Reproduction Steps: Name yourself [], and watch the intro cutscene. When Robin says your name, the event crashes. Events have a crash handler so it doesn't crash the game, but having an NPC say your name (such as Pierre in his first dialogue) will fully crash the game. Incidentally, in SMAPI, it causes an infinite freeze instead.
Code Analysis: In Dialogue.prepareCurrentDialogueForDisplay, the game searches for ['s followed by an ]. Then, it splits it by space. In a normal id command, that results in a list such as ['24', '26', '128']. It proceeds to check every item in the list for validity, and if any are invalid it aborts. Finally, it picks a random element and creates it. However, with [], the split-by-space list is empty. When it attempts to check for validity, no item in the list is invalid - because the list is empty. The random choice, then, gives a null response, which crashes when attempting to create an item with a null item id.
Suggested Fix: Add a check in prepareCurrentDialogueForDisplay for an empty list.
Reproduction Steps: Name yourself [], and watch the intro cutscene. When Robin says your name, the event crashes. Events have a crash handler so it doesn't crash the game, but having an NPC say your name (such as Pierre in his first dialogue) will fully crash the game. Incidentally, in SMAPI, it causes an infinite freeze instead.
Code Analysis: In Dialogue.prepareCurrentDialogueForDisplay, the game searches for ['s followed by an ]. Then, it splits it by space. In a normal id command, that results in a list such as ['24', '26', '128']. It proceeds to check every item in the list for validity, and if any are invalid it aborts. Finally, it picks a random element and creates it. However, with [], the split-by-space list is empty. When it attempts to check for validity, no item in the list is invalid - because the list is empty. The random choice, then, gives a null response, which crashes when attempting to create an item with a null item id.
Suggested Fix: Add a check in prepareCurrentDialogueForDisplay for an empty list.