Fixed unit part progress with multiple weapons

This commit is contained in:
Anuken 2024-07-10 13:24:03 -04:00
parent bd4b56857e
commit 92e121c05c

View File

@ -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);
}