Fix crash on login/logout?
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -276,7 +276,7 @@ public class ProfilePanel
|
||||
if (ImGuiUtil.DrawDisabledButton("Apply to mannequin", buttonWidth, string.Empty, !_actorAssignmentUi.CanSetMannequin))
|
||||
_manager.AddCharacter(_selector.Selected!, _actorAssignmentUi.MannequinIdentifier);
|
||||
|
||||
var currentPlayer = _actorManager.GetCurrentPlayer();
|
||||
var currentPlayer = _actorManager.GetCurrentPlayer().CreatePermanent();
|
||||
if (ImGuiUtil.DrawDisabledButton("Apply to current character", buttonWidth, string.Empty, !currentPlayer.IsValid))
|
||||
_manager.AddCharacter(_selector.Selected!, currentPlayer);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ public class BoneEditorPanel
|
||||
if (ImGuiUtil.DrawDisabledButton("Apply to mannequin", buttonWidth, string.Empty, !_actorAssignmentUi.CanSetMannequin))
|
||||
_editorManager.ChangeEditorCharacter(_actorAssignmentUi.MannequinIdentifier);
|
||||
|
||||
var currentPlayer = _gameObjectService.GetCurrentPlayerActorIdentifier();
|
||||
var currentPlayer = _gameObjectService.GetCurrentPlayerActorIdentifier().CreatePermanent();
|
||||
if (ImGuiUtil.DrawDisabledButton("Apply to current character", buttonWidth, string.Empty, !currentPlayer.IsValid))
|
||||
_editorManager.ChangeEditorCharacter(currentPlayer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user