Remove deprecated integer facing handling for Lua
This commit is contained in:
@@ -224,12 +224,6 @@ namespace OpenRA
|
|||||||
if (!left.TryGetClrValue(out WAngle a))
|
if (!left.TryGetClrValue(out WAngle a))
|
||||||
throw new LuaException($"Attempted to call WAngle.Add(WAngle, WAngle) with invalid arguments ({left.WrappedClrType().Name}, {right.WrappedClrType().Name})");
|
throw new LuaException($"Attempted to call WAngle.Add(WAngle, WAngle) with invalid arguments ({left.WrappedClrType().Name}, {right.WrappedClrType().Name})");
|
||||||
|
|
||||||
if (right.TryGetClrValue(out int c))
|
|
||||||
{
|
|
||||||
TextNotificationsManager.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle");
|
|
||||||
return new LuaCustomClrObject(a + FromFacing(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (right.TryGetClrValue(out WAngle b))
|
if (right.TryGetClrValue(out WAngle b))
|
||||||
return new LuaCustomClrObject(a + b);
|
return new LuaCustomClrObject(a + b);
|
||||||
|
|
||||||
@@ -241,12 +235,6 @@ namespace OpenRA
|
|||||||
if (!left.TryGetClrValue(out WAngle a))
|
if (!left.TryGetClrValue(out WAngle a))
|
||||||
throw new LuaException($"Attempted to call WAngle.Subtract(WAngle, WAngle) with invalid arguments ({left.WrappedClrType().Name}, {right.WrappedClrType().Name})");
|
throw new LuaException($"Attempted to call WAngle.Subtract(WAngle, WAngle) with invalid arguments ({left.WrappedClrType().Name}, {right.WrappedClrType().Name})");
|
||||||
|
|
||||||
if (right.TryGetClrValue(out int c))
|
|
||||||
{
|
|
||||||
TextNotificationsManager.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle");
|
|
||||||
return new LuaCustomClrObject(a - FromFacing(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (right.TryGetClrValue(out WAngle b))
|
if (right.TryGetClrValue(out WAngle b))
|
||||||
return new LuaCustomClrObject(a - b);
|
return new LuaCustomClrObject(a - b);
|
||||||
|
|
||||||
|
|||||||
@@ -71,17 +71,6 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: Backward compatibility for legacy int facings
|
|
||||||
if (init is FacingInit facingInit)
|
|
||||||
{
|
|
||||||
if (value.TryGetClrValue(out int facing))
|
|
||||||
{
|
|
||||||
facingInit.Initialize(WAngle.FromFacing(facing));
|
|
||||||
TextNotificationsManager.Debug("Initializing Facing with integers is deprecated. Use Angle instead.");
|
|
||||||
return facingInit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var initializers = initType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
|
var initializers = initType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
|
||||||
.Where(m => m.Name == "Initialize" && m.GetParameters().Length == 1);
|
.Where(m => m.Name == "Initialize" && m.GetParameters().Length == 1);
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
#region Copyright & License Information
|
|
||||||
/*
|
|
||||||
* Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
|
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
|
||||||
* available to you under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. For more
|
|
||||||
* information, see COPYING.
|
|
||||||
*/
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
using OpenRA.Scripting;
|
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Scripting.Global
|
|
||||||
{
|
|
||||||
[ScriptGlobal("Facing")]
|
|
||||||
public class FacingGlobal : ScriptGlobal
|
|
||||||
{
|
|
||||||
public FacingGlobal(ScriptContext context)
|
|
||||||
: base(context) { }
|
|
||||||
|
|
||||||
void Deprecated()
|
|
||||||
{
|
|
||||||
TextNotificationsManager.Debug("The Facing table is deprecated. Use Angle instead.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public int North { get { Deprecated(); return 0; } }
|
|
||||||
public int NorthWest { get { Deprecated(); return 32; } }
|
|
||||||
public int West { get { Deprecated(); return 64; } }
|
|
||||||
public int SouthWest { get { Deprecated(); return 96; } }
|
|
||||||
public int South { get { Deprecated(); return 128; } }
|
|
||||||
public int SouthEast { get { Deprecated(); return 160; } }
|
|
||||||
public int East { get { Deprecated(); return 192; } }
|
|
||||||
public int NorthEast { get { Deprecated(); return 224; } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user