Skip to content

Commit f14d66b

Browse files
committed
Next stab at fixing multi-mode engines
Issue #341
1 parent c5ce0cb commit f14d66b

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

Source/MASVesselComputerModules.cs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,15 +1389,10 @@ static void TransferModules<T>(List<T> sourceList, ref T[] destArray)
13891389
if (sourceList.Count != destArray.Length)
13901390
{
13911391
destArray = new T[sourceList.Count];
1392-
1393-
// Assume the list can't change without changing size -
1394-
// I shouldn't be able to add a module and remove a module
1395-
// of the same type in a single transaction, right?
1396-
// For whatever reason, this copy is faster than List.CopyTo()
1397-
for (int i = sourceList.Count - 1; i >= 0; --i)
1398-
{
1399-
destArray[i] = sourceList[i];
1400-
}
1392+
}
1393+
for (int i = sourceList.Count - 1; i >= 0; --i)
1394+
{
1395+
destArray[i] = sourceList[i];
14011396
}
14021397
sourceList.Clear();
14031398
}
@@ -1812,14 +1807,14 @@ private void UpdateModuleData()
18121807
modulesInvalidated = false;
18131808
scienceInvalidated = false;
18141809
}
1815-
else if (multiModeEngines.Length > 0)
1816-
{
1817-
// Multi-mode engines are a special case, since when they switch modes, the active engines change, but the array length does not.
1818-
// A clever implementation would keep track of which modes are active, and detect when that changes, but I'm
1819-
// hoping that this isn't a common enough use that I need to spend the extra zots being smart enough to get that
1820-
// working cleanly.
1821-
RebuildMultiModeEngines();
1822-
}
1810+
//else if (multiModeEngines.Length > 0)
1811+
//{
1812+
// // Multi-mode engines are a special case, since when they switch modes, the active engines change, but the array length does not.
1813+
// // A clever implementation would keep track of which modes are active, and detect when that changes, but I'm
1814+
// // hoping that this isn't a common enough use that I need to spend the extra zots being smart enough to get that
1815+
// // working cleanly.
1816+
// RebuildMultiModeEngines();
1817+
//}
18231818
if (scienceInvalidated)
18241819
{
18251820
RebuildScienceTypes();

0 commit comments

Comments
 (0)