Skip to content

Commit

Permalink
seed
Browse files Browse the repository at this point in the history
i added seed because if u dont its not random so :)
  • Loading branch information
poweredbypie committed Feb 3, 2021
1 parent 2c3b824 commit 9aaff64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions randomize-menu-music/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DWORD WINAPI attach(void* hModule) {
}

if (valid) {
globals::validLoops.push_back("menuLoops/" + loop.path().filename().u8string());
globals::validLoops.push_back(loop.path().string());
}
}
}
Expand All @@ -55,9 +55,18 @@ DWORD WINAPI attach(void* hModule) {
}
else {
char* gdBase = reinterpret_cast<char*>(GetModuleHandle(0));
globals::distribution = std::uniform_int_distribution(0,
static_cast<int>(
globals::validLoops.size() - 1));

globals::distribution = std::uniform_int_distribution {
0, static_cast<int>(globals::validLoops.size() - 1)
};

globals::generator = std::default_random_engine {
static_cast<unsigned int>(
std::chrono::system_clock::now()
.time_since_epoch()
.count()
)
};

hk fadeInMusic = {
gdBase + 0xC4BD0,
Expand Down
1 change: 1 addition & 0 deletions randomize-menu-music/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
#include <vector>
#include <string_view>
#include <random>
#include <chrono>

#endif //PCH_H

0 comments on commit 9aaff64

Please sign in to comment.