Mac Simultanious multiplayer marriage with krobus causes issues

CandyNim

Tiller
Note - I didn't test this one on the latest version (because I didn't want to set up a save for it) so I can't confirm that it hasn't been patched yet, but I don't think it has been at a look at code.

Bug: If two players marry both Krobus and another NPC on the same day, there's a chance that the wedding cutscene for the other player won't happen.
Analysis:
When it's time to get married, overnight the game queues up a list of every person who needs to get married today. The order of this list is the unique multiplayer id, which is a completely random number. (See Game1.queueWeddingsToday and the list Game1.weddingsToday)

In OnDayStarted, the game calls resetForPlayerEntry which calls resetLocalState. This happens once, because you don't need to reset it multiple times! In resetLocalState, it calls checkForEvents.

In checkForEvents, it sets currentEvent to Game1.getAvailableWeddingEvent and if it wasn't null plays the cutscene. getAvailableWeddingEvent takes the first person who is queued for marriage, says "remove them from the queue to get married", and returns the appropriate cutscene.

Intended behavior for multiple marriages: You get swept into the first marriage cutscene, and when that cutscene ends you're back on the farm and resetLocalState is called again! Sweeping you into the second marriage cutscene.

Unintended behavior when Krobus is the first marriage checked: There is no marriage cutscene for Krobus, and so it returns null and then as long as you don't go anywhere (the marriage event will happen if you leave your house) no other NPC marriage cutscene happens because it never calls checkForEvents again.

Potential fix: Instead of returning null when getAvailableWeddingEvent finds krobus as the spouse, it instead returns getAvailableWeddingEvent again, essentially looping until it finds the first cutscene that actually happens. You could also replace the `if (Game1.weddingsToday.Count > 0)` check with a `while (Game1.weddingsToday.Count > 0)` and continue the loop instead of returning null.
 
Top