mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-27 17:16:31 +00:00
Fix: Some platforms not using the same RNG for every roll (#1103)
* Test changes * Update ObjectIDManager.h * Revert "Update ObjectIDManager.h" This reverts commit 3e4d169718d0bc64b61fb5feaf39437ca4284294. * Revert "Test changes" This reverts commit 8e16573f937473785f91e04a13b177084fee3ed0. * Use random engine
This commit is contained in:
parent
238751f14e
commit
e47169fec5
@ -1,8 +1,5 @@
|
|||||||
#include "ObjectIDManager.h"
|
#include "ObjectIDManager.h"
|
||||||
|
|
||||||
// Std
|
|
||||||
#include <random>
|
|
||||||
|
|
||||||
// Custom Classes
|
// Custom Classes
|
||||||
#include "MasterPackets.h"
|
#include "MasterPackets.h"
|
||||||
#include "Database.h"
|
#include "Database.h"
|
||||||
@ -48,11 +45,7 @@ void ObjectIDManager::HandleRequestPersistentIDResponse(uint64_t requestID, uint
|
|||||||
|
|
||||||
//! Handles cases where we have to get a unique object ID synchronously
|
//! Handles cases where we have to get a unique object ID synchronously
|
||||||
uint32_t ObjectIDManager::GenerateRandomObjectID() {
|
uint32_t ObjectIDManager::GenerateRandomObjectID() {
|
||||||
std::random_device rd;
|
return uni(Game::randomEngine);
|
||||||
|
|
||||||
std::mt19937 rng(rd());
|
|
||||||
|
|
||||||
return uni(rng);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user