Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stormdrive handle_control_rod_efficiency() divides by zero, and causes runtime errors. #2705

Open
jet-pack-cat opened this issue Aug 24, 2024 · 0 comments

Comments

@jet-pack-cat
Copy link

https://github.com/BeeStation/NSV13/blob/52337049ee3e3d78d99ccb4a3549695fc92e3171/nsv13/code/modules/power/stormdrive.dm#L719C1-L723C75

control_rod_modifier = control_rod_effectiveness_total / control_rods.len

image
^very sad!

ISSUE

"handle_control_rod_efficiency()" divides by zero when you remove all the rods.
When there's no rods control_rods.len = 0, and 0/0 is NAN.

STEPS TO REPRODUCE

  1. PUT ROD IN
  2. TAKE ROD OUT
  3. RUNTIME ERROR LIKE A BOSS

This function causes many other "fun" things, and also maybe probably (definitely not) intended behavior. Have fun if you decide to fix it. :)

Could have been funnier if byond handled it differently.
Made me spend like 9 hours figuring why this was inconsistent with my simulator then realizing it was a runtime error with byond.

Client: 515.1643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant