HuskInfection unsubscribes from the OnDeath event when the infection is cured (-> cured characters don't turn into husks when they die)

This commit is contained in:
Regalis
2017-01-07 14:45:17 +02:00
parent a5f0d1d7da
commit 629df6aab3
2 changed files with 13 additions and 2 deletions
+7 -2
View File
@@ -336,8 +336,13 @@ namespace Barotrauma
if (value <= 0.0f)
{
if (huskInfection != null && huskInfection.State == HuskInfection.InfectionState.Active) return;
huskInfection = null;
if (huskInfection != null)
{
//already active, can't cure anymore
if (huskInfection.State == HuskInfection.InfectionState.Active) return;
huskInfection.Remove(this);
huskInfection = null;
}
}
else
{