Wire IndexOutOfRange fix

This commit is contained in:
Regalis
2016-12-09 14:49:36 +02:00
parent d95acec6a2
commit f04ebf1503

View File

@@ -432,7 +432,7 @@ namespace Barotrauma.Items.Components
section.Draw(spriteBatch, item.Color, drawOffset, depth, 0.3f);
}
if (IsActive && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)
if (IsActive && nodes.Count > 0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)
{
WireSection.Draw(
spriteBatch,