Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); In-development patch notes for Starsector 0.98a (2/8/25)

Author Topic: ElectronicWarfareScript and ECCM Package Bug  (Read 440 times)

Jackie

  • Ensign
  • *
  • Posts: 38
    • View Profile
ElectronicWarfareScript and ECCM Package Bug
« on: June 09, 2022, 06:14:40 PM »

A post made me investigate this issue: https://fractalsoftworks.com/forum/index.php?topic=22670.msg367257#msg367257

I had assumed the bonus was hardcoded to only ECCM Package, but this doesn't seem to be the case. ECCM Package does not reduce weapon range penalties from losing Electronic Warfare!

ElectronicWarfareScript seems to have currPenalty redefined again that ignores the ELECTRONIC_WARFARE_PENALTY_MULT!
Code
float currPenalty = penalty * member.getShip().getMutableStats().getDynamic().getValue(Stats.ELECTRONIC_WARFARE_PENALTY_MULT);
currPenalty = member.getShip().getMutableStats().getDynamic().getValue(Stats.ELECTRONIC_WARFARE_PENALTY_MOD, penalty);

I was able to fix this issue for the ECCM Package by replacing:
Code
stats.getDynamic().getStat(Stats.ELECTRONIC_WARFARE_PENALTY_MULT).modifyMult(id, EW_PENALTY_MULT);
with
Code
stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_PENALTY_MOD).modifyMult(id, EW_PENALTY_MULT);
Logged
Don't compare your life to others if you have no idea what their life is all about.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25148
    • View Profile
Re: ElectronicWarfareScript and ECCM Package Bug
« Reply #1 on: June 09, 2022, 07:21:34 PM »

Thank you for the report! Fixed.

(By changing that second currPenalty = ... line in the script to:
currPenalty = member.getShip().getMutableStats().getDynamic().getValue(Stats.ELECTRONIC_WARFARE_PENALTY_MOD, currPenalty);)
Logged