Skip to content

Commit 4fdf1ad

Browse files
committed
remove incorrectly filled description and private info
1 parent fd6cb9f commit 4fdf1ad

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎Torch/Patches/FactionPatch.cs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ public static bool InitPrefix(MyObjectBuilder_FactionCollection builder, MyFacti
102102
factionBuilder.Name = factionBuilder.Name.Substring(0, Math.Min(factionBuilder.Name.Length, MAX_FACTION_NAME_LENGTH));
103103
factionBuilder.Tag = factionBuilder.Tag.Substring(0, Math.Min(factionBuilder.Tag.Length, NPC_FACTION_TAG_LENGTH));
104104

105+
//sorry
106+
if (factionBuilder.Description.Contains("Potentially Exploited Faction"))
107+
factionBuilder.Description = string.Empty;
108+
109+
if (factionBuilder.PrivateInfo.Contains("Potentially Exploited Faction"))
110+
factionBuilder.PrivateInfo = string.Empty;
111+
112+
if (string.IsNullOrWhiteSpace(factionBuilder.Name))
113+
factionBuilder.Name = $"Potentially Exploited Faction {_factionCounter}";
114+
115+
if (string.IsNullOrWhiteSpace(factionBuilder.Tag))
116+
factionBuilder.Tag = $"PEF{_factionCounter}";
117+
105118
//do the same substring but with null checks for the description and private info
106119
if (factionBuilder.Description != null)
107120
factionBuilder.Description = factionBuilder.Description.Substring(0, Math.Min(factionBuilder.Description.Length, MAX_FACTION_INFO_LENGTH));
@@ -243,7 +256,7 @@ private static string CleanUpStringInput(string input, int factionCountCurrent)
243256
return input;
244257
}
245258

246-
input = input.Replace('&', ' ').Replace('#', ' ');
259+
return input.Replace('&', ' ').Replace('#', ' ');
247260
//do the same but after, if the input is an empty string or just whitespace, return "Potentially Exploited Faction (INVESTIGATE)"
248261
return string.IsNullOrWhiteSpace(input) ? $"Potentially Exploited Faction data (INVESTIGATE)-{factionCountCurrent}" : input;
249262
}

0 commit comments

Comments
 (0)