Fixed nullref exceptions when a character dies while holding an item.
This commit is contained in:
@@ -2044,6 +2044,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
base.Remove();
|
base.Remove();
|
||||||
|
|
||||||
|
if (selectedItems[0] != null) selectedItems[0].Drop(this);
|
||||||
|
if (selectedItems[1] != null) selectedItems[1].Drop(this);
|
||||||
|
|
||||||
if (info != null) info.Remove();
|
if (info != null) info.Remove();
|
||||||
|
|
||||||
CharacterList.Remove(this);
|
CharacterList.Remove(this);
|
||||||
@@ -2054,9 +2057,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (AnimController != null) AnimController.Remove();
|
if (AnimController != null) AnimController.Remove();
|
||||||
|
|
||||||
if (selectedItems[0] != null) selectedItems[0].Drop(this);
|
|
||||||
if (selectedItems[1] != null) selectedItems[1].Drop(this);
|
|
||||||
|
|
||||||
foreach (Character c in CharacterList)
|
foreach (Character c in CharacterList)
|
||||||
{
|
{
|
||||||
if (c.focusedCharacter == this) c.focusedCharacter = null;
|
if (c.focusedCharacter == this) c.focusedCharacter = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user