v1.0.20.1 (summer patch)
This commit is contained in:
+14
-5
@@ -97,11 +97,18 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (holdable != null && !holdable.Attached)
|
||||
{
|
||||
trigger.Enabled = false;
|
||||
if (trigger != null)
|
||||
{
|
||||
trigger.Enabled = false;
|
||||
}
|
||||
IsActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (trigger == null)
|
||||
{
|
||||
CreateTriggerBody();
|
||||
}
|
||||
if (trigger != null && Vector2.DistanceSquared(item.SimPosition, trigger.SimPosition) > 0.01f)
|
||||
{
|
||||
trigger.SetTransform(item.SimPosition, 0.0f);
|
||||
@@ -123,12 +130,15 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
holdable.PickingTime = float.MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateTriggerBody()
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(trigger == null, "LevelResource trigger already created!");
|
||||
var body = item.body ?? holdable.Body;
|
||||
|
||||
if (body != null)
|
||||
if (body != null && Attached)
|
||||
{
|
||||
trigger = new PhysicsBody(body.Width, body.Height, body.Radius,
|
||||
trigger = new PhysicsBody(body.Width, body.Height, body.Radius,
|
||||
body.Density,
|
||||
BodyType.Static,
|
||||
Physics.CollisionWall,
|
||||
@@ -143,7 +153,6 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
protected override void RemoveComponentSpecific()
|
||||
{
|
||||
base.RemoveComponentSpecific();
|
||||
if (trigger != null)
|
||||
{
|
||||
trigger.Remove();
|
||||
|
||||
Reference in New Issue
Block a user