Codechange: move choice for randomizer of scripts to a single location

This commit is contained in:
Rubidium
2023-01-13 23:48:59 +01:00
committed by rubidium42
parent 3373128233
commit 6abad681bd
7 changed files with 23 additions and 19 deletions

View File

@@ -311,3 +311,10 @@ bool ScriptObject::DoCommandProcessResult(const CommandCost &res, Script_Suspend
NOT_REACHED();
}
Randomizer &ScriptObject::GetRandomizer()
{
/* We pick _random if we are in SP (so when saved, we do the same over and over)
* but we pick _interactive_random if we are a network_server or network-client. */
return _networking ? _interactive_random : _random;
}