From 50d01ef6f842e47c6b6b3aa2a31a30c798e1988a Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 22 Aug 2021 10:21:20 -0400 Subject: [PATCH] FlyingComp cleanup --- core/src/mindustry/entities/comp/FlyingComp.java | 6 +++++- core/src/mindustry/entities/comp/WaterMoveComp.java | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/FlyingComp.java b/core/src/mindustry/entities/comp/FlyingComp.java index 94db2f6a63..75022a9ad1 100644 --- a/core/src/mindustry/entities/comp/FlyingComp.java +++ b/core/src/mindustry/entities/comp/FlyingComp.java @@ -41,6 +41,10 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{ return isGrounded() && !hovering; } + boolean emitWalkSound(){ + return true; + } + void landed(){ } @@ -80,7 +84,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{ floor.walkEffect.at(x, y, hitSize() / 8f, floor.mapColor); splashTimer = 0f; - if(!(this instanceof WaterMovec)){ + if(emitWalkSound()){ floor.walkSound.at(x, y, Mathf.random(floor.walkSoundPitchMin, floor.walkSoundPitchMax), floor.walkSoundVolume); } } diff --git a/core/src/mindustry/entities/comp/WaterMoveComp.java b/core/src/mindustry/entities/comp/WaterMoveComp.java index ce008279cf..bf5c15a5f0 100644 --- a/core/src/mindustry/entities/comp/WaterMoveComp.java +++ b/core/src/mindustry/entities/comp/WaterMoveComp.java @@ -44,6 +44,13 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ return Pathfinder.costNaval; } + //don't want obnoxious splashing + @Override + @Replace + public boolean emitWalkSound(){ + return false; + } + @Override public void add(){ tleft.clear();