pioneerspacesim/pioneer — pull request #2445 by lwho (2013-09-29 19:48:08+00:00)
Title: Let Rand.New(seed) raise an error if seed is given, but non-numeric.

As was learned by @TheNewBob the hard way the documentation of `Rand.New` falsely claimed that `Rand:New(seed)` instead of `Rand.New(seed)` (i.e. with colon instead of period) was the right syntax to create a new random generator.

This passed the Rand table as the seed which was ignored by Rand.New because of not being numeric, creating a random generator based on the current time, instead of the seed thus creating different numbers (see http://pioneerspacesim.net/forum/viewtopic.php?f=3&t=16&start=50#p683 for the whole story).

I think, such silent failure is a bad thing. This PR fixes the documentation and causes Rand.New to raise a LUA error if `seed` is given but not numeric. Not giving any seed still creates a time-based random generator.