Skip to content

Commit

Permalink
Miscellaneous fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Regynate committed Feb 11, 2025
1 parent e767262 commit da5979a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ChaosMod/Util/OptionsFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OptionsFile

public:
OptionsFile(const char *fileName, std::vector<const char *> compatFileNames = {})
: m_FileName(fileName), m_FoundFileName(""), m_CompatFileNames(compatFileNames)
: m_FileName(fileName), m_FoundFileName(fileName), m_CompatFileNames(compatFileNames)
{
Reset();
}
Expand Down Expand Up @@ -73,7 +73,7 @@ class OptionsFile
std::ofstream file(m_FoundFileName, std::ofstream::out | std::ofstream::trunc);
if (!file)
{
LOG("Couldn't write config file " << m_FileName);
LOG("Couldn't write config file " << m_FoundFileName);
return;
}
for (auto &[key, value] : m_Options)
Expand Down
2 changes: 1 addition & 1 deletion ConfigApp/Workshop/WorkshopEditDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ string handleEffectId(string itemName)
if (file.Type == WorkshopSubmissionFileType.Sound)
{
var effectId = itemName;
if (!Effects.EffectsMap.ContainsKey(effectId))
if (!Effects.EffectsMap.ContainsKey(effectId) && itemName.Length > 4)
effectId = itemName[..^4];
if (Effects.EffectsMap.ContainsKey(effectId))
itemName += $" ({Effects.EffectsMap[effectId].Name})";
Expand Down
2 changes: 1 addition & 1 deletion ConfigApp/Workshop/WorkshopSubmissionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void UpdateSearchTerms()
{
foreach (var line in File.ReadAllLines(m_FileHandler.SubmissionDirectory + file.Name))
{
var match = Regex.Match(line, @"(?:Name|ScriptId)\s*=\s*""((?:\\""|[^""])+)""");
var match = Regex.Match(line, @"(?:Name|ScriptId|EffectId)\s*=\s*""((?:\\""|[^""])+)""");
if (match.Success)
{
SearchTerms.Add(new(match.Groups[1].Value, file.Name));
Expand Down

0 comments on commit da5979a

Please sign in to comment.