Remove direct access to MapPreview.Rules.
This commit is contained in:
@@ -73,12 +73,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Display order for the game speed option in the lobby.")]
|
||||
public readonly int GameSpeedDropdownDisplayOrder = 0;
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("shortgame", ShortGameCheckboxLabel, ShortGameCheckboxDescription,
|
||||
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
|
||||
|
||||
var techLevels = rules.Actors[SystemActors.Player].TraitInfos<ProvidesTechPrerequisiteInfo>()
|
||||
var techLevels = map.PlayerActorInfo.TraitInfos<ProvidesTechPrerequisiteInfo>()
|
||||
.ToDictionary(t => t.Id, t => t.Name);
|
||||
|
||||
if (techLevels.Any())
|
||||
|
||||
Reference in New Issue
Block a user