Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.95a-RC15] weapon.getAmmoTracker().setAmmoPerSecond is not working  (Read 486 times)

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile

I am running this code to dynamically give a specific missile weapon that does not reload, a 24 second reload cycle for 32 rounds:

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.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile

Thank you, fixed!
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile

Thank you, fixed!
Fast! Thank you very much. Looking forward to the next patch.
Logged