Add a single-argument constructor to HealthInit

...which is a requirement for an ActorInit to be usable with the Lua API's Actor.Create() method.
This commit is contained in:
Oliver Brakmann
2016-07-14 19:45:03 +02:00
parent 7593cf3b63
commit 417e9ca71f

View File

@@ -209,7 +209,10 @@ namespace OpenRA.Mods.Common.Traits
[FieldFromYamlKey] readonly int value = 100;
readonly bool allowZero;
public HealthInit() { }
public HealthInit(int init, bool allowZero = false)
public HealthInit(int init)
: this(init, false) { }
public HealthInit(int init, bool allowZero)
{
this.allowZero = allowZero;
value = init;