From 92e121c05c4ad385c38b567c4f6e2e97b8acdc78 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 10 Jul 2024 13:24:03 -0400 Subject: [PATCH] Fixed unit part progress with multiple weapons --- core/src/mindustry/type/UnitType.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 34c3b537df..3408948807 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -1282,9 +1282,9 @@ public class UnitType extends UnlockableContent implements Senseable{ for(int i = 0; i < parts.size; i++){ var part = parts.get(i); - WeaponMount first = unit.mounts.length > part.weaponIndex ? unit.mounts[part.weaponIndex] : null; - if(first != null){ - DrawPart.params.set(first.warmup, first.reload / weapons.first().reload, first.smoothReload, first.heat, first.recoil, first.charge, unit.x, unit.y, unit.rotation); + WeaponMount mount = unit.mounts.length > part.weaponIndex ? unit.mounts[part.weaponIndex] : null; + if(mount != null){ + DrawPart.params.set(mount.warmup, mount.reload / mount.weapon.reload, mount.smoothReload, mount.heat, mount.recoil, mount.charge, unit.x, unit.y, unit.rotation); }else{ DrawPart.params.set(0f, 0f, 0f, 0f, 0f, 0f, unit.x, unit.y, unit.rotation); }