PreventCollision with strap component while buckled to it (#2694)
* AvoidCollision if collided entity is the one that the character is buckled to * Attempt to PreventCollision after the player is unbuckled but still colliding with StrapComponent * Moved PreventCollide to the Shared script. * Add WakeBody to keep updating the physics collision while being on a collidable strap component. * Addressed some of metalgearsloth's suggestions: - Made EntityBuckledTo,IsOnStrapEntityThisFrame and DontCollide not virtual -Made EntityBuckledTo nullable -Don't call update on Paused BuckleComponents -Removed EntityBuckledTo variable declaration in BuckleComponent because it's not needed anymore -Call TryUnbuckle if (!IsOnStrapEntityThisFrame && DontCollide) to set BuckledTo entity to null. * Formatting Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Formatting Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Formatting again :P Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Formatting Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Formatting Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Renamed variable EntityBuckledTo to LastEntityBuckledTo * As per DrSmugLeaf suggestion: Added [ComponentDependency] to the Body variable. Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,14 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
SubscribeLocalEvent<EntRemovedFromContainerMessage>(ContainerModified);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var comp in ComponentManager.EntityQuery<BuckleComponent>(false))
|
||||
{
|
||||
comp.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
Reference in New Issue
Block a user