1010#include < common/mods.hh>
1111
1212#include < scrThread.hh>
13+ #include < Random.hh>
1314
1415#include " CModelInfo.hh"
1516#include " Utils.hh"
@@ -80,10 +81,11 @@ class PedRandomizer
8081 return model;
8182
8283 // Forced Ped
83- if (!PR::Config ().ForcedPed .empty ())
84+ if (!PR::Config ().ForcedPedHashes .empty ())
8485 {
8586 uint32_t id = CStreaming::GetModelIndex (
86- rage::atStringHash (PR::Config ().ForcedPed ));
87+ PR::Config ().ForcedPedHashes [ 0 , RandomInt (PR::Config ()
88+ .ForcedPedHashes .size () - 1 ) ]);
8789
8890 if (CStreaming::HasModelLoaded (id))
8991 return id;
@@ -176,7 +178,6 @@ class PedRandomizer
176178 /* ******************************************************/
177179 PedRandomizer ()
178180 {
179- std::string ForcedPed;
180181#define OPTION (option ) std::pair (#option, &PR::Config ().option)
181182
182183 if (!ConfigManager::ReadConfig (
@@ -191,8 +192,33 @@ class PedRandomizer
191192 return;
192193
193194 if (PR::Config ().ForcedPed .size ())
194- PR::Config ().ForcedPedHash
195- = rage::atStringHash (PR::Config ().ForcedPed );
195+ {
196+ std::string forcedPeds = PR::Config ().ForcedPed ;
197+
198+ while (true )
199+ {
200+ size_t splitPos = forcedPeds.find (' ,' );
201+
202+ std::string forcedPed = forcedPeds.substr (0 , splitPos);
203+
204+ // trimming
205+ forcedPed.erase (0 , forcedPed.find_first_not_of (' ' ));
206+ if (forcedPed.find_last_not_of (' ' ) != forcedPed.npos )
207+ forcedPed.erase (forcedPed.find_last_not_of (' ' ) + 1 );
208+
209+ // just in case it was just whitespace
210+ if (forcedPed.size ())
211+ PR::Config ().ForcedPedHashes
212+ .push_back (rage::atStringHash (forcedPed));
213+
214+ if (splitPos == forcedPeds.npos )
215+ {
216+ break ;
217+ }
218+
219+ forcedPeds.erase (0 , splitPos + 1 );
220+ }
221+ }
196222
197223 InitialiseAllComponents ();
198224
0 commit comments