diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index cf24a24d45..f42438c122 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -274,9 +274,13 @@ namespace CalamityMod // case CalamityModMessageType.SyncDifficulties: + int sender = reader.ReadInt32(); CalamityWorld.revenge = reader.ReadBoolean(); CalamityWorld.death = reader.ReadBoolean(); //TODO - Something so that other mods that hijack the difficulty ui can also use the remainder of the reader to have their own shit + + if (Main.netMode == NetmodeID.Server) + SyncCalamityWorldDifficulties(sender); break; // @@ -307,19 +311,19 @@ namespace CalamityMod NetMessage.SendData(MessageID.WorldData); } - public static void SyncCalamityWorldDifficulties() + public static void SyncCalamityWorldDifficulties(int sender) { if (Main.netMode == NetmodeID.SinglePlayer) return; var netMessage = CalamityMod.Instance.GetPacket(); netMessage.Write((byte)CalamityModMessageType.SyncDifficulties); + netMessage.Write(sender); netMessage.Write(CalamityWorld.revenge); netMessage.Write(CalamityWorld.death); //TODO - Let other mods also add their own bits in that sync. Ideally would be done through the difficultystem itself - - netMessage.Send(-1, Main.myPlayer); + netMessage.Send(-1, sender); } public static void NewNPC_ClientSide(Vector2 spawnPosition, int npcType, Player player) diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs index 8650b35d7d..21ed9608da 100644 --- a/UI/ModeIndicatorUI.cs +++ b/UI/ModeIndicatorUI.cs @@ -447,7 +447,7 @@ namespace CalamityMod.UI mode.Enabled = true; SoundEngine.PlaySound(mode.ActivationSound); - CalamityNetcode.SyncCalamityWorldDifficulties(); + CalamityNetcode.SyncCalamityWorldDifficulties(Main.myPlayer); menuOpen = false; menuOpenTransitionTime = MenuAnimLenght;