Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.9 RC 9] Fatal / by zero error if you custom produce free weapons  (Read 1187 times)

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2847
  • Your Friendly Forum Friend
    • View Profile

So I found out that if you have a weapon that doesn't have a credit cost (like a system or a fighter weapon) and you custom produce it, you will get a "Fatal: / by zero" error and the game will CTD at the end of the month.
Full stack trace:
Spoiler
76293 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ArithmeticException: / by zero
java.lang.ArithmeticException: / by zero
   at com.fs.starfarer.api.impl.campaign.CoreScript.doCustomProduction(CoreScript.java:783)
   at com.fs.starfarer.api.impl.campaign.CoreScript.reportEconomyMonthEnd(CoreScript.java:919)
   at com.fs.starfarer.campaign.CampaignEngine.reportEconomyMonthEnd(Unknown Source)
   at com.fs.starfarer.campaign.econ.reach.ReachEconomyStepper.doEndOfMonthStuff(Unknown Source)
   at com.fs.starfarer.campaign.econ.reach.ReachEconomyStepper.nextFrame(Unknown Source)
   at com.fs.starfarer.campaign.econ.Economy.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

[close]
Steps to reproduce:
Step 0: Have a colony that can custom order/ produce weapons
Step 1: Order the free weapon
Step 2: Wait until the end of the month
Step 3: Crash
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: [0.9 RC 9] Fatal / by zero error if you custom produce free weapons
« Reply #1 on: November 18, 2018, 10:59:43 AM »

Thanks for the report! Is this possible in vanilla?
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2847
  • Your Friendly Forum Friend
    • View Profile
Re: [0.9 RC 9] Fatal / by zero error if you custom produce free weapons
« Reply #2 on: November 18, 2018, 11:36:18 AM »

Thanks for the report! Is this possible in vanilla?
I think it should be if you set a weapon to no credit cost. As for right now? No, all of vanilla's weapons, besides the flare launchers and deco weapons, have credit values. I just wanted to make this bug report in case someone DID get hit with it. I should have put it in the modded section, sorry.
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: [0.9 RC 9] Fatal / by zero error if you custom produce free weapons
« Reply #3 on: November 18, 2018, 11:42:01 AM »

No worries, just making sure. Fixed this up!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: [0.9 RC 9] Fatal / by zero error if you custom produce free weapons
« Reply #4 on: November 18, 2018, 11:43:08 AM »

(Gah, I keep accidentally moving threads to "Modding" instead of "Bug Reports & Support (modded)". Sigh.)
Logged