Skip to content
Snippets Groups Projects
Commit 9a12296a authored by pregmodfan's avatar pregmodfan
Browse files

fix for variable precission lost in .preg with slow down drugs

parent ddebe62c
No related branches found
No related tags found
3 merge requests!843Delete Please.,!833Pregmod master,!758Pregmod master
...@@ -309,11 +309,12 @@ ...@@ -309,11 +309,12 @@
<<if $slaves[_i].preg > 0>> <<if $slaves[_i].preg > 0>>
<<if $slaves[_i].pregControl == "slow gestation">> <<if $slaves[_i].pregControl == "slow gestation">>
<<set $slaves[_i].preg += 0.5>> <<set $slaves[_i].preg += 0.5>>
<<set $slaves[_i].preg = (Math.ceil($slaves[_i].preg*10)/10)>> /* trick to avoid precission lost error showed like week: 29.499999999999998*/
<<elseif $slaves[_i].pregControl == "speed up">> <<elseif $slaves[_i].pregControl == "speed up">>
<<set $slaves[_i].preg += 2>> <<set $slaves[_i].preg += 2>>
<<else>> <<else>>
<<set $slaves[_i].preg++>> <<set $slaves[_i].preg++>>
<</if>> <</if>>
<</if>> <</if>>
/* end of preg speed control changes*/ /* end of preg speed control changes*/
<<if ($slaves[_i].scars == 3)>> <<if ($slaves[_i].scars == 3)>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment