Skip to content

Commit

Permalink
Probably fixed crash for when there are duplicate NPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase W committed Apr 8, 2017
1 parent 64140d5 commit 57207f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions StardewValleyMP/Packets/WorldDataPacket.cs
Expand Up @@ -283,15 +283,15 @@ private void fixRelationships( SaveGame mine, SaveGame world )
foreach ( GameLocation loc in mine.locations )
{
foreach (NPC npc in loc.characters)
if (npc.isVillager())
if (npc.isVillager() && !dating.ContainsKey(npc.name))
dating.Add(npc.name, npc.datingFarmer);
if ( loc is BuildableGameLocation )
{
foreach ( Building building in ( loc as BuildableGameLocation ).buildings )
{
if (building.indoors == null) continue;
foreach (NPC npc in building.indoors.characters)
if (npc.isVillager())
if (npc.isVillager() && !dating.ContainsKey(npc.name))
dating.Add(npc.name, npc.datingFarmer);
}
}
Expand Down

0 comments on commit 57207f9

Please sign in to comment.