Don't add replay resource ID offset multiple times

This commit is contained in:
baldurk
2015-11-27 13:46:56 +01:00
parent 5cbb2653d3
commit 4361eb83d2
+4 -1
View File
@@ -39,7 +39,10 @@ namespace ResourceIDGen
// separate replay IDs from live IDs by adding a value when replaying.
// 1000000000000000000 live IDs before we overlap replay IDs gives
// almost 32 years generating 100000 IDs per frame at 10000 FPS.
globalIDCounter = RDCMAX(uint64_t(globalIDCounter), uint64_t(globalIDCounter+1000000000000000000ULL));
// only add this value once (since we're not |'ing on a bit)
if(globalIDCounter < 1000000000000000000ULL)
globalIDCounter = RDCMAX(uint64_t(globalIDCounter), uint64_t(globalIDCounter+1000000000000000000ULL));
}
};