rng.percent(-10) always return true

Moderator: Moderator

Post Reply
Message
Author
Marcotte
Wyrmic
Posts: 203
Joined: Sat Jan 26, 2008 1:12 am

rng.percent(-10) always return true

#1 Post 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.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

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

#2 Post by darkgod »

Weird indeed.
Some casting errors I suppose.

Fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply