Page 1 of 1

[Rseding91] Research progress >100% issue

Posted: Fri Sep 02, 2016 4:41 pm
by bobingabout
I got this report.
viewtopic.php?f=51&t=31718&start=30#p201886

I don't know how it happened... I listed my code a couple posts later, all it does is store the progress reported by the LUA script, and restore it if you change back. So the game itself had to have research going past 100% in the first place for my mod to attempt to restore it. Someone theorises a mod changing the cost of a technology down while it is already in progress in a save file...

Anyway, Wouldn't it be a relatively simple fix to change your game code to use a >= check for this?

Re: Research progress >100% issue

Posted: Fri Sep 02, 2016 5:59 pm
by Rseding91
bobingabout wrote:Anyway, Wouldn't it be a relatively simple fix to change your game code to use a >= check for this?
I'm not sure what you mean. There's already a > check in place - that's why you get the error when attempting to set the research to > 1.

As for why you got a value > 1 - it's probably as you said: someone changed the technology prototype while it was in progress. I'll add a check during loading that correct the research progress if someone changes the research prototype while research is in progress so it shouldn't ever give a value > 1.

Re: [Rseding91] Research progress >100% issue

Posted: Fri Sep 02, 2016 8:36 pm
by Rseding91
Fixed for 0.14.4.

Re: [Rseding91] Research progress >100% issue

Posted: Fri Sep 02, 2016 10:08 pm
by Digital_Cake_
Super glad this was fixed, I've suffered the same problem for quite some time and I'm glad to see it finally getting fixed..

Re: [Rseding91] Research progress >100% issue

Posted: Fri Sep 02, 2016 10:39 pm
by bobingabout
Wonderful.

I've written a fix for my mod as well, so it should never attempt to write >1 too.