ItemComponents that don't implement the IDrawableComponent interface can't be added to the list of drawable components, pickTimer is ignored when deattaching items from the walls in the editor
This commit is contained in:
@@ -117,17 +117,22 @@ namespace Barotrauma.Items.Components
|
||||
set
|
||||
{
|
||||
if (value == drawable) return;
|
||||
if (!(this is IDrawableComponent))
|
||||
{
|
||||
DebugConsole.ThrowError("Couldn't make ''"+this+"'' drawable (the component doesn't implement the IDrawableComponent interface)");
|
||||
return;
|
||||
}
|
||||
|
||||
drawable = value;
|
||||
if (drawable)
|
||||
{
|
||||
if (!item.drawableComponents.Contains(this as IDrawableComponent))
|
||||
item.drawableComponents.Add(this as IDrawableComponent);
|
||||
if (!item.drawableComponents.Contains((IDrawableComponent)this))
|
||||
item.drawableComponents.Add((IDrawableComponent)this);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.drawableComponents.Remove(this as IDrawableComponent);
|
||||
}
|
||||
|
||||
item.drawableComponents.Remove((IDrawableComponent)this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user