diff --git a/src/CMakeData-singletons.cmake b/src/CMakeData-singletons.cmake index 1ccc75de7b..90868e8be1 100644 --- a/src/CMakeData-singletons.cmake +++ b/src/CMakeData-singletons.cmake @@ -45,7 +45,6 @@ list(APPEND SMDATA_GLOBAL_SINGLETON_HPP "NoteSkinManager.h" "PrefsManager.h" "ProfileManager.h" - "RandomSeed.h" "ScreenManager.h" "SongManager.h" "StatsManager.h" diff --git a/src/Player.cpp b/src/Player.cpp index 6ce0ab022d..a34d3bc910 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -39,7 +39,6 @@ #include "GameCommand.h" #include "LocalizedString.h" #include "AdjustSync.h" -#include "RandomSeed.h" #include #include @@ -3475,7 +3474,8 @@ RString Player::ApplyRandomAttack() if( GAMESTATE->m_RandomAttacks.size() < 1 ) return ""; - int iAttackToUse = GetRandomInt() % GAMESTATE->m_RandomAttacks.size(); + int iAttackToUse = RandomInt(GAMESTATE->m_RandomAttacks.size()); + return GAMESTATE->m_RandomAttacks[iAttackToUse]; } diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 1df321b36b..d19647a5b6 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include const RString CUSTOM_SONG_PATH= "/@mem/"; diff --git a/src/RandomSeed.h b/src/RandomSeed.h deleted file mode 100644 index 873124b72f..0000000000 --- a/src/RandomSeed.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef RANDOMSEED_H -#define RANDOMSEED_H - -#include -#include - -inline int GetRandomInt() -{ - static std::random_device rd; - static std::mt19937 gen(rd()); - return std::uniform_int_distribution(0, INT_MAX)(gen); -} - -#endif // RANDOMSEED_H - -/* - * (c) 2024 sukibaby - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */