mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +02:00
Seed love.math.random when the math module is loaded, instead of in love.run.
--HG-- branch : minor
This commit is contained in:
@@ -32,6 +32,9 @@
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
|
||||
// C
|
||||
#include <time.h>
|
||||
|
||||
using std::list;
|
||||
using love::Vector2;
|
||||
|
||||
@@ -359,6 +362,10 @@ Math::Math()
|
||||
{
|
||||
// prevent the runtime from free()-ing this
|
||||
retain();
|
||||
|
||||
RandomGenerator::Seed seed;
|
||||
seed.b64 = (uint64) time(nullptr);
|
||||
rng.setSeed(seed);
|
||||
}
|
||||
|
||||
Math::~Math()
|
||||
|
||||
Reference in New Issue
Block a user