misc optimization & refactoring
This commit is contained in:
@@ -179,7 +179,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
if (containedItem == null) continue;
|
||||
|
||||
containedItem.sprite.Draw(
|
||||
containedItem.Sprite.Draw(
|
||||
spriteBatch,
|
||||
new Vector2(transformedItemPos.X, -transformedItemPos.Y),
|
||||
-currentRotation,
|
||||
|
||||
@@ -82,7 +82,16 @@ namespace Subsurface.Items.Components
|
||||
public virtual bool IsActive
|
||||
{
|
||||
get { return isActive; }
|
||||
set { isActive = value; }
|
||||
set
|
||||
{
|
||||
if (!value && isActive)
|
||||
{
|
||||
StopSounds(ActionType.OnActive);
|
||||
StopSounds(ActionType.OnUse);
|
||||
}
|
||||
|
||||
isActive = value;
|
||||
}
|
||||
}
|
||||
|
||||
[HasDefaultValue(false, false)]
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace Subsurface.Items.Components
|
||||
stickJoint.MaxMotorForce = 30.0f;
|
||||
|
||||
stickJoint.LimitEnabled = true;
|
||||
stickJoint.UpperLimit = ConvertUnits.ToSimUnits(item.sprite.size.X*0.7f);
|
||||
stickJoint.UpperLimit = ConvertUnits.ToSimUnits(item.Sprite.size.X*0.7f);
|
||||
|
||||
item.body.FarseerBody.IgnoreCollisionWith(targetBody);
|
||||
stickTarget = targetBody;
|
||||
|
||||
Reference in New Issue
Block a user