From bd4c7d68d0b95e5a0a21ede7ea80c4db1f357ce1 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 9 Jul 2017 16:17:44 +0300 Subject: [PATCH] Fixed endless messagebox spam when the controlled character turns into a husk, fixed an index our of range exception when merging firesources --- .../BarotraumaClient/Source/Characters/HuskInfection.cs | 4 ++-- .../BarotraumaShared/Source/Characters/HuskInfection.cs | 4 ++-- Barotrauma/BarotraumaShared/Source/Map/FireSource.cs | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Characters/HuskInfection.cs b/Barotrauma/BarotraumaClient/Source/Characters/HuskInfection.cs index 26dda3a2b..3325c80e7 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/HuskInfection.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/HuskInfection.cs @@ -20,9 +20,9 @@ namespace Barotrauma new GUIMessageBox("", InfoTextManager.GetInfoText("HuskCantSpeak")); } } - else + else if (state != InfectionState.Active && Character.Controlled == character) { - if (Character.Controlled == character) new GUIMessageBox("", InfoTextManager.GetInfoText("HuskActivate")); + new GUIMessageBox("", InfoTextManager.GetInfoText("HuskActivate")); } } } diff --git a/Barotrauma/BarotraumaShared/Source/Characters/HuskInfection.cs b/Barotrauma/BarotraumaShared/Source/Characters/HuskInfection.cs index 84dbf9eff..48abfc1fd 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/HuskInfection.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/HuskInfection.cs @@ -44,6 +44,7 @@ namespace Barotrauma { float prevTimer = IncubationTimer; + UpdateProjSpecific(prevTimer,character); if (IncubationTimer < 0.5f) { UpdateDormantState(deltaTime, character); @@ -56,7 +57,6 @@ namespace Barotrauma { UpdateActiveState(deltaTime, character); } - UpdateProjSpecific(prevTimer,character); } partial void UpdateProjSpecific(float prevTimer, Character character); @@ -86,7 +86,7 @@ namespace Barotrauma state = InfectionState.Active; } - character.AddDamage(CauseOfDeath.Husk, 0.5f*deltaTime, null); + character.AddDamage(CauseOfDeath.Husk, 0.5f * deltaTime, null); } diff --git a/Barotrauma/BarotraumaShared/Source/Map/FireSource.cs b/Barotrauma/BarotraumaShared/Source/Map/FireSource.cs index bf3be9908..96e67d473 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/FireSource.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/FireSource.cs @@ -117,11 +117,9 @@ namespace Barotrauma { for (int j = i - 1; j >= 0; j--) { - if (fireSources[i].hull != fireSources[j].hull) continue; - i = Math.Min(i, fireSources.Count - 1); j = Math.Min(j, i - 1); - + if (!fireSources[i].CheckOverLap(fireSources[j])) continue; float leftEdge = Math.Min(fireSources[i].position.X, fireSources[j].position.X);