1
Bug Reports & Support (modded) / [0.95a-RC15] weapon.getAmmoTracker().setAmmoPerSecond is not working
« on: April 26, 2021, 08:42:41 PM »
I am running this code to dynamically give a specific missile weapon that does not reload, a 24 second reload cycle for 32 rounds:
However, only the setReloadSize() command is working properly, as shown by the debug logs inserted in the code:
Simulator testing also reveals that the missile weapon is still not reloading.
Code
for(WeaponAPI weapon : ship.getAllWeapons()) {
if(weapon.getType().compareTo(WeaponType.MISSILE) != 0) {
continue;
}
reloadData = BASE_VALUES.get(weapon.getId());
log.info("found missile " + weapon.getId());
if(reloadData != null) {
log.info("found *correct*! missile " + weapon.getId() + " | " + reloadData.ammopersec + " | " + reloadData.reloadSize);
weapon.getAmmoTracker().setAmmoPerSecond(reloadData.ammopersec);
weapon.getAmmoTracker().setReloadSize(reloadData.reloadSize);
log.info("check " + weapon.getId() + " | " + weapon.getAmmoTracker().getAmmoPerSecond() + " | " + weapon.getAmmoTracker().getReloadSize());
}
}
However, only the setReloadSize() command is working properly, as shown by the debug logs inserted in the code:
Code
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_aam_3
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_aam_3
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_sead_58
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_PART_missile_frigate_b_srm_33
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found *correct*! missile yrxp_PART_missile_frigate_b_srm_33 | 1.3333334 | 32.0
38216 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - check yrxp_PART_missile_frigate_b_srm_33 | 0.0 | 32.0
Simulator testing also reveals that the missile weapon is still not reloading.