Skip to content

Commit e04cad5

Browse files
author
Roberto De Ioris
committed
improved set_random_seed()
1 parent 9db8af0 commit e04cad5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Source/UnrealEnginePython/Private/UEPyEngine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,10 @@ PyObject *py_unreal_engine_set_random_seed(PyObject * self, PyObject * args)
12361236
return nullptr;
12371237
}
12381238

1239+
// Thanks to Sven Mika (Ducandu GmbH) for spotting this
12391240
FMath::RandInit(seed);
1241+
FGenericPlatformMath::SRandInit(seed);
1242+
FGenericPlatformMath::RandInit(seed);
12401243

12411244
Py_RETURN_NONE;
12421245
}

0 commit comments

Comments
 (0)