From 2250d86f3a4e117865f687f9e02a20fbc065a914 Mon Sep 17 00:00:00 2001 From: Red Dango <23718392+RedDango@users.noreply.github.com> Date: Fri, 19 Aug 2022 17:02:38 +0800 Subject: [PATCH] Change MT to C rand Because I don't want to be like Mihoyo --- cheat-library/src/user/cheat/world/AutoLoot.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cheat-library/src/user/cheat/world/AutoLoot.cpp b/cheat-library/src/user/cheat/world/AutoLoot.cpp index ff9ad14..602ad44 100644 --- a/cheat-library/src/user/cheat/world/AutoLoot.cpp +++ b/cheat-library/src/user/cheat/world/AutoLoot.cpp @@ -14,8 +14,6 @@ namespace cheat::feature static bool LCSelectPickup_IsOutPosition_Hook(void* __this, app::BaseEntity* entity, MethodInfo* method); float g_default_range = 3.0f; - static std::random_device rd; - static std::mt19937 rng(rd()); AutoLoot::AutoLoot() : Feature(), NF(f_AutoPickup, "Auto-pickup drops", "AutoLoot", false), @@ -242,8 +240,7 @@ namespace cheat::feature int fluctuation = 0; if (f_UseDelayTimeFluctuation) { - std::uniform_int_distribution uni(0, f_DelayTimeFluctuation); - fluctuation = uni(rng); + fluctuation = std::rand() % (f_DelayTimeFluctuation + 1); } nextLootTime = currentTime + (int)f_DelayTime + fluctuation;