Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove the deprecated Difficulty member from MapGlobal (lua)
  • Loading branch information
abcdefg30 authored and reaperrr committed Mar 23, 2018
1 parent ea68f1a commit d15b462
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs
Expand Up @@ -110,20 +110,6 @@ public string TerrainType(CPos cell)
[Desc("Returns true if there is only one human player.")]
public bool IsSinglePlayer { get { return Context.World.LobbyInfo.NonBotPlayers.Count() == 1; } }

[Desc("Returns the difficulty selected by the player before starting the mission.")]
public string Difficulty
{
get
{
Game.Debug("Map script is using deprecated Map.Difficulty API. This should be changed to Map.LobbyOption(\"difficulty\").");
Log.Write("lua", "Map script is using deprecated Map.Difficulty API. This should be changed to Map.LobbyOption(\"difficulty\").");
var option = Context.World.WorldActor.TraitsImplementing<ScriptLobbyDropdown>()
.FirstOrDefault(sld => sld.Info.ID == "difficulty");

return option != null ? option.Info.Values[option.Value] : null;
}
}

[Desc("Returns the value of a `ScriptLobbyDropdown` selected in the game lobby.")]
public LuaValue LobbyOption(string id)
{
Expand Down

0 comments on commit d15b462

Please sign in to comment.