misc optimization & refactoring

This commit is contained in:
Regalis
2015-09-29 18:03:38 +03:00
parent cc16bb3ad7
commit 45178e745b
30 changed files with 820 additions and 210 deletions
@@ -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;