mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
seed random number generator in ScriptEngine for Math.random use in JS
This commit is contained in:
parent
affd499188
commit
f8c479f9c5
1 changed files with 5 additions and 0 deletions
|
@ -235,6 +235,11 @@ void ScriptEngine::init() {
|
|||
// let the VoxelPacketSender know how frequently we plan to call it
|
||||
_voxelsScriptingInterface.getVoxelPacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS);
|
||||
_particlesScriptingInterface.getParticlePacketSender()->setProcessCallIntervalHint(SCRIPT_DATA_CALLBACK_USECS);
|
||||
|
||||
// call srand to seed the random number generator
|
||||
srand(QDateTime::currentMSecsSinceEpoch()
|
||||
+ QCoreApplication::applicationPid()
|
||||
+ NodeList::getInstance()->getNodeSocket().localPort());
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue