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:
@@ -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
|
||||
{
|
||||
|
||||
@@ -143,6 +143,12 @@ namespace Barotrauma
|
||||
character.AnimController.AddJoint(jointElement);
|
||||
}
|
||||
|
||||
public void Remove(Character character)
|
||||
{
|
||||
if (character != null)
|
||||
character.OnDeath -= CharacterDead;
|
||||
}
|
||||
|
||||
private void CharacterDead(Character character, CauseOfDeath causeOfDeath)
|
||||
{
|
||||
var husk = Character.Create(
|
||||
|
||||
Reference in New Issue
Block a user