Page 1 of 1

rng.percent(-10) always return true

Posted: Mon Jan 24, 2011 3:42 am
by Marcotte
As written in the title: calling rng.percent() with a negative parameter always return true.

This is a little counterintuitive, as I expected that it would always return false for a negative parameter, and always true for a parameter higher than 100. And looking at the source code (core_lua.c line 1473), I have no idea why it is not the case.

Re: rng.percent(-10) always return true

Posted: Mon Jan 24, 2011 8:14 am
by darkgod
Weird indeed.
Some casting errors I suppose.

Fixed