Fix error when disconnecting the client while a projectile is embedded (#36048)
* Add test for disconnecting the client while a projectile is embedded * Add check for non-terminating grid or map * Add test that an embeddable detaches when the target is deleted. * Remove Explicit tag from TestDisconnectWhileEmbedded
This commit is contained in:
@@ -143,6 +143,8 @@ public abstract partial class SharedProjectileSystem : EntitySystem
|
||||
}
|
||||
|
||||
var xform = Transform(uid);
|
||||
if (TerminatingOrDeleted(xform.GridUid) && TerminatingOrDeleted(xform.MapUid))
|
||||
return;
|
||||
TryComp<PhysicsComponent>(uid, out var physics);
|
||||
_physics.SetBodyType(uid, BodyType.Dynamic, body: physics, xform: xform);
|
||||
_transform.AttachToGridOrMap(uid, xform);
|
||||
|
||||
Reference in New Issue
Block a user