Attempted fix for drawableComponents crash + LOS tweaks

This commit is contained in:
juanjp600
2016-10-12 19:24:39 -03:00
parent 7e6ef65eb3
commit 506ef2f2aa
5 changed files with 23 additions and 10 deletions

View File

@@ -872,12 +872,13 @@ namespace Barotrauma
prefab.sprite.effects = oldEffects;
for (int i = 0; i < drawableComponents.Count; i++ )
List<IDrawableComponent> staticDrawableComponents = new List<IDrawableComponent>(drawableComponents); //static list to compensate for drawable toggling
for (int i = 0; i < staticDrawableComponents.Count; i++ )
{
drawableComponents[i].Draw(spriteBatch, editing);
staticDrawableComponents[i].Draw(spriteBatch, editing);
}
//foreach (ItemComponent component in components) component.Draw(spriteBatch, editing);
//foreach (ItemComponent component in components) component.Draw(spriteBatch, editing);
if (GameMain.DebugDraw && aiTarget!=null) aiTarget.Draw(spriteBatch);