Browse Source

Fix random module/cable ID generation on Windows

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
36f062e33d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/engine/Engine.cpp

+ 2
- 2
src/engine/Engine.cpp View File

@@ -700,7 +700,7 @@ void Engine::addModule(Module* module) {
// Set ID if unset or collides with an existing ID
while (module->id < 0 || internal->modulesCache.find(module->id) != internal->modulesCache.end()) {
// Randomly generate ID
module->id = random::u64() % (1ul << 53);
module->id = random::u64() % (1ull << 53);
}
// Add module
internal->modules.push_back(module);
@@ -872,7 +872,7 @@ void Engine::addCable(Cable* cable) {
// Set ID if unset or collides with an existing ID
while (cable->id < 0 || internal->cablesCache.find(cable->id) != internal->cablesCache.end()) {
// Randomly generate ID
cable->id = random::u64() % (1ul << 53);
cable->id = random::u64() % (1ull << 53);
}
// Add the cable
internal->cables.push_back(cable);


Loading…
Cancel
Save