Fix docking adding comps to terminating entities (#11010)

This commit is contained in:
Leon Friedrich 2022-09-04 19:26:20 +12:00 committed by GitHub
parent 0eedb5088c
commit ff61bc12a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -461,13 +461,13 @@ namespace Content.Server.Shuttles.Systems
_doorSystem.TryClose(doorB.Owner, doorB);
}
if (!Deleted(dock.Owner))
if (LifeStage(dock.Owner) < EntityLifeStage.Terminating)
{
var recentlyDocked = EnsureComp<RecentlyDockedComponent>(dock.Owner);
recentlyDocked.LastDocked = dock.DockedWith.Value;
}
if (!Deleted(dock.DockedWith.Value))
if (TryComp(dock.DockedWith.Value, out MetaDataComponent? meta) && meta.EntityLifeStage < EntityLifeStage.Terminating)
{
var recentlyDocked = EnsureComp<RecentlyDockedComponent>(dock.DockedWith.Value);
recentlyDocked.LastDocked = dock.DockedWith.Value;