- if (next_random == 1)
- next_random = GetTickCount();
-
- next_random *= 6364136223846793005;
- next_random += 1;
-
- return (uint32_t)(next_random >> 32) % 0xffffffff;
+// g_nextrandom *= 6364136223846793005;
+// g_nextrandom += 1;
+//return (uint32_t)(g_nextrandom >> 32) % 0xffffffff;
+ g_nextrandom = (214013 * g_nextrandom + 2531011);
+ return (g_nextrandom>>16) & 0xFFFF;