Fix cursed locker collision (#3759)
This commit is contained in:
@@ -279,17 +279,8 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Contents.CanInsert(entity))
|
|
||||||
{
|
return Contents.CanInsert(entity) && Insert(entity);
|
||||||
Contents.Insert(entity);
|
|
||||||
entity.Transform.LocalPosition = Vector2.Zero;
|
|
||||||
if (entityPhysicsComponent != null)
|
|
||||||
{
|
|
||||||
entityPhysicsComponent.CanCollide = false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Vector2 ContentsDumpPosition()
|
public virtual Vector2 ContentsDumpPosition()
|
||||||
@@ -365,7 +356,14 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Contents.Insert(entity);
|
if (!Contents.Insert(entity)) return false;
|
||||||
|
|
||||||
|
entity.Transform.LocalPosition = Vector2.Zero;
|
||||||
|
if (entity.TryGetComponent(out IPhysBody? body))
|
||||||
|
{
|
||||||
|
body.CanCollide = false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Reference in New Issue
Block a user