Add ability to prevent ghosting (#12906)

* add ability to prevent ghosting to MindComponent.cs

* make minds preserve properties in certain transfer scenarios

* Revert "make minds preserve properties in certain transfer scenarios"

This reverts commit 333cae0db0faf4ef81767b93332271d944c90a0e.

* move PreventGhosting to the actual mind
This commit is contained in:
Chief-Engineer
2022-12-19 21:55:45 -06:00
committed by GitHub
parent f08b1be48c
commit fdb1181298
5 changed files with 21 additions and 3 deletions

View File

@@ -156,6 +156,14 @@ namespace Content.Server.GameTicking
if (handleEv.Handled)
return handleEv.Result;
if (mind.PreventGhosting)
{
if (mind.Session != null)
// Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
_chatManager.DispatchServerMessage(mind.Session, Loc.GetString("comp-mind-ghosting-prevented"), true);
return false;
}
var playerEntity = mind.CurrentEntity;
var entities = IoCManager.Resolve<IEntityManager>();