Fixed OnUse StatusEffects not being applied when a turret is launched. Closes #975

This commit is contained in:
Joonas Rikkonen
2018-12-25 20:38:47 +02:00
parent 4cc2216faf
commit 35e22d3e66
2 changed files with 11 additions and 1 deletions

View File

@@ -57,6 +57,11 @@ namespace Barotrauma.Items.Components
powerIndicator = new GUIProgressBar(new Rectangle(GameMain.GraphicsWidth / 2 - barWidth / 2, 20, barWidth, 30), Color.White, 0.0f);
}
partial void LaunchProjSpecific()
{
PlaySound(ActionType.OnUse, item.WorldPosition);
}
public void Draw(SpriteBatch spriteBatch, bool editing = false)
{
Vector2 drawPos = new Vector2(item.Rect.X, item.Rect.Y);
@@ -159,7 +164,6 @@ namespace Barotrauma.Items.Components
}
Launch(projectile);
PlaySound(ActionType.OnUse, item.WorldPosition);
}
}
}

View File

@@ -219,6 +219,10 @@ namespace Barotrauma.Items.Components
projectile.FindHull();
projectile.Submarine = projectile.body.Submarine;
LaunchProjSpecific();
ApplyStatusEffects(ActionType.OnUse, 1.0f, user);
Projectile projectileComponent = projectile.GetComponent<Projectile>();
if (projectileComponent != null)
{
@@ -234,6 +238,8 @@ namespace Barotrauma.Items.Components
}
}
partial void LaunchProjSpecific();
public override bool AIOperate(float deltaTime, Character character, AIObjectiveOperateItem objective)
{
var projectiles = GetLoadedProjectiles();