Codechange: do not use interactive random anymore for script configuration

This commit is contained in:
Rubidium
2023-01-14 13:38:05 +01:00
committed by rubidium42
parent c5ff61c5f2
commit 921c6591f9
2 changed files with 5 additions and 8 deletions

View File

@@ -14,6 +14,7 @@
#include "../core/random_func.hpp"
#include "../script/squirrel_class.hpp"
#include "../script/api/script_object.hpp"
#include "ai_info.hpp"
#include "ai_scanner.hpp"
@@ -77,12 +78,7 @@ AIInfo *AIScannerInfo::SelectRandomAI() const
}
/* Find a random AI */
uint pos;
if (_networking) {
pos = InteractiveRandomRange(num_random_ais);
} else {
pos = RandomRange(num_random_ais);
}
uint pos = ScriptObject::GetRandomizer(OWNER_NONE).Next(num_random_ais);
/* Find the Nth item from the array */
ScriptInfoList::const_iterator it = this->info_single_list.begin();