Skip to content

Commit acb26c3

Browse files
committed
Fixed crash when blocks had space in their subtypeId.
1 parent 128518a commit acb26c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Projector2LCD/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ private List<KeyValuePair<string, int>> GetTotalComponents(IMyProjector projecto
430430
// blockInfo[0] is blueprint, blockInfo[1] is number of required item
431431
string[] blockInfo = item.ToString().Trim(remove).Split(delimiters, StringSplitOptions.None);
432432

433-
string blockName = blockInfo[0];
433+
string blockName = blockInfo[0].Replace(" ", ""); // data in blockDefinitionData is compressed removing spaces
434434
int amount = Convert.ToInt32(blockInfo[1]);
435435

436436
if (blockName.StartsWith("SmallBlock"))

ProjectorResourceBuilder/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private List<KeyValuePair<string, int>> GetTotalComponents(IMyProjector projecto
106106
// blockInfo[0] is blueprint, blockInfo[1] is number of required item
107107
string[] blockInfo = item.ToString().Trim(remove).Split(delimiters, StringSplitOptions.None);
108108

109-
string blockName = blockInfo[0];
109+
string blockName = blockInfo[0].Replace(" ", ""); // data in blockDefinitionData is compressed removing spaces
110110
int amount = Convert.ToInt32(blockInfo[1]);
111111

112112
if (blockName.StartsWith("SmallBlock"))

0 commit comments

Comments
 (0)