Skip to content

Commit 49b220a

Browse files
committed
Fix invalid condition for "limit to my creatures", a bit of additional logging
1 parent 2fdf223 commit 49b220a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CustomizePlus/Profiles/ProfileManager.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void Dispose()
9595

9696
public void LoadProfiles()
9797
{
98-
_logger.Information("Loading profiles from directory...");
98+
_logger.Information("Loading profiles...");
9999

100100
//todo: hot reload was not tested
101101
//save temp profiles
@@ -105,6 +105,8 @@ public void LoadProfiles()
105105
List<(Profile, string)> invalidNames = new();
106106
foreach (var file in _saveService.FileNames.Profiles())
107107
{
108+
_logger.Debug($"Reading profile {file.FullName}");
109+
108110
try
109111
{
110112
var text = File.ReadAllText(file.FullName);
@@ -146,7 +148,7 @@ public void LoadProfiles()
146148
_logger.Information(
147149
$"Moved {invalidNames.Count - failed} profiles to correct names.{(failed > 0 ? $" Failed to move {failed} profiles to correct names." : string.Empty)}");
148150

149-
_logger.Information("Directory load complete");
151+
_logger.Information("Profiles load complete");
150152
_event.Invoke(ProfileChanged.Type.ReloadedAll, null, null);
151153
}
152154

@@ -506,7 +508,7 @@ bool IsProfileAppliesToCurrentActor(Profile profile)
506508
return profile.CharacterName.Text == name &&
507509
(!profile.LimitLookupToOwnedObjects ||
508510
(actorIdentifier.Type == IdentifierType.Owned &&
509-
actorIdentifier.PlayerName != _actorManager.GetCurrentPlayer().PlayerName));
511+
actorIdentifier.PlayerName == _actorManager.GetCurrentPlayer().PlayerName));
510512
}
511513

512514
if (_templateEditorManager.IsEditorActive && _templateEditorManager.EditorProfile.Enabled && IsProfileAppliesToCurrentActor(_templateEditorManager.EditorProfile))

CustomizePlus/Templates/TemplateManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ public TemplateManager(
4545

4646
public void LoadTemplates()
4747
{
48-
_logger.Information("Loading templates from directory...");
48+
_logger.Information("Loading templates...");
4949

5050
_templates.Clear();
5151
List<(Template, string)> invalidNames = new();
5252
foreach (var file in _saveService.FileNames.Templates())
5353
{
54+
_logger.Debug($"Reading template {file.FullName}");
5455
try
5556
{
5657
var text = File.ReadAllText(file.FullName);
@@ -77,7 +78,7 @@ public void LoadTemplates()
7778
_logger.Information(
7879
$"Moved {invalidNames.Count - failed} templates to correct names.{(failed > 0 ? $" Failed to move {failed} templates to correct names." : string.Empty)}");
7980

80-
_logger.Information("Directory load complete");
81+
_logger.Information("Templates load complete");
8182
_event.Invoke(TemplateChanged.Type.ReloadedAll, null, null);
8283
}
8384

0 commit comments

Comments
 (0)