1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 12:14:11 +01:00

Codechange: use ReferenceThroughBaseContainer for containers that are index by CompanyID

This commit is contained in:
Rubidium
2025-02-10 18:03:01 +01:00
committed by rubidium42
parent 1ffc950e22
commit 5401ab1f7b
13 changed files with 23 additions and 20 deletions

View File

@@ -347,7 +347,7 @@ bool ScriptObject::DoCommandProcessResult(const CommandCost &res, Script_Suspend
}
/* static */ Randomizer ScriptObject::random_states[OWNER_END];
/* static */ ScriptObject::RandomizerArray ScriptObject::random_states;
Randomizer &ScriptObject::GetRandomizer(Owner owner)
{

View File

@@ -330,7 +330,8 @@ private:
static std::tuple<bool, bool, bool, bool> DoCommandPrep();
static bool DoCommandProcessResult(const CommandCost &res, Script_SuspendCallbackProc *callback, bool estimate_only, bool asynchronous);
static CommandCallbackData *GetDoCommandCallback();
static Randomizer random_states[OWNER_END]; ///< Random states for each of the scripts (game script uses OWNER_DEITY)
using RandomizerArray = ReferenceThroughBaseContainer<std::array<Randomizer, OWNER_END>>;
static RandomizerArray random_states; ///< Random states for each of the scripts (game script uses OWNER_DEITY)
};
namespace ScriptObjectInternal {