Replaced instances where MapEntityPrefabs are searched for based on the name with a static Find method that takes the aliases of the prefabs into account.

This commit is contained in:
Joonas Rikkonen
2017-11-14 21:40:43 +02:00
parent d072713936
commit 5f4bf48449
17 changed files with 141 additions and 130 deletions
@@ -390,7 +390,7 @@ namespace Barotrauma.Items.Components
for (int i = 0; i < 2; i++)
{
hullRects[i].Location -= MathUtils.ToPoint((subs[i].WorldPosition - subs[i].HiddenSubPosition));
hulls[i] = new Hull(MapEntityPrefab.list.Find(m => m.Name == "Hull"), hullRects[i], subs[i]);
hulls[i] = new Hull(MapEntityPrefab.Find("Hull"), hullRects[i], subs[i]);
hulls[i].AddToGrid(subs[i]);
for (int j = 0; j < 2; j++)
@@ -420,7 +420,7 @@ namespace Barotrauma.Items.Components
for (int i = 0; i < 2; i++)
{
hullRects[i].Location -= MathUtils.ToPoint((subs[i].WorldPosition - subs[i].HiddenSubPosition));
hulls[i] = new Hull(MapEntityPrefab.list.Find(m => m.Name == "Hull"), hullRects[i], subs[i]);
hulls[i] = new Hull(MapEntityPrefab.Find("Hull"), hullRects[i], subs[i]);
hulls[i].AddToGrid(subs[i]);
if (hullIds[i] != null) hulls[i].ID = (ushort)hullIds[i];