ClaudeMetz / FactoryPlanner

A mod for Factorio. Allows you to plan out your production in detail.
https://mods.factorio.com/mod/factoryplanner
MIT License
101 stars 47 forks source link

Negative beacon amounts induces crash #415

Closed Xevion closed 1 week ago

Xevion commented 1 week ago

Problem Description

I was editing the Beacon amount to test the mathematical expression evaluations (because I can't type floats, because not all my refineries get an equal amount of beacons), and somehow typed something that crashed it.

The last thing I had typed in the box was 18-21.

image

factorio-current.log

Reproduction

No response

Xevion commented 1 week ago

Apparently, any negative number typed in the box is an instant crash, so... yeah.

Not that I have much knowledge of Factorio modding, Lua programming or can really judge, but shouldn't a lot of these functions be validating input properly? This feels like something I would account for in my own projects naturally. Maybe if I'm making a comment like this, perhaps I should be willing to contribute though...

ClaudeMetz commented 1 week ago

Thanks for the report. This whole thing is kind of tricky on the backend, and the validation needs to be done manually in a sense. I missed the negative part. Will have a look at fixing it.

ClaudeMetz commented 1 week ago

Fixed for the next release.