Fix crash on login/logout?

This commit is contained in:
RisaDev
2025-07-25 02:19:48 +03:00
parent 8c59e1b3ad
commit 8b3220cba6
3 changed files with 5 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ public class TemplateEditorManager : IDisposable
};
if (!Character.IsValid) //safeguard
ChangeEditorCharacterInternal(_gameObjectService.GetCurrentPlayerActorIdentifier()); //will set EditorProfile.Character
ChangeEditorCharacterInternal(_gameObjectService.GetCurrentPlayerActorIdentifier().CreatePermanent()); //will set EditorProfile.Character
EditorProfile.Templates.Clear(); //safeguard
EditorProfile.Templates.Add(CurrentlyEditedTemplate);
@@ -335,6 +335,8 @@ public class TemplateEditorManager : IDisposable
return;
}
localPlayer = localPlayer.CreatePermanent();
if (_configuration.EditorConfiguration.PreviewCharacter != localPlayer)
{
_logger.Debug("Resetting editor character because automatic condition triggered in OnLogin");