Fix loop sound persisting after the payload carrier is removed. (#8034)

* Properly remove units and blocks in the case that the carrier dies

* added = false

---------

Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
MEEPofFaith
2025-02-06 10:23:11 -08:00
committed by GitHub
parent de8087e1af
commit 527e2ee09c
4 changed files with 18 additions and 0 deletions

View File

@@ -61,6 +61,13 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
}
@Override
public void remove(){
for(Payload pay : payloads){
pay.remove();
}
payloads.clear();
}
public void destroy(){
if(Vars.state.rules.unitPayloadsExplode) payloads.each(Payload::destroyed);
}