Changed missed ActorInfo.Traits.Contains => ActorInfo.HasTraitInfo
This commit is contained in:
@@ -254,9 +254,9 @@ namespace OpenRA.Scripting
|
|||||||
static readonly object[] NoArguments = new object[0];
|
static readonly object[] NoArguments = new object[0];
|
||||||
Type[] FilterActorCommands(ActorInfo ai)
|
Type[] FilterActorCommands(ActorInfo ai)
|
||||||
{
|
{
|
||||||
var method = typeof(TypeDictionary).GetMethod("Contains");
|
var method = typeof(ActorInfo).GetMethod("HasTraitInfo");
|
||||||
return knownActorCommands.Where(c => ExtractRequiredTypes(c)
|
return knownActorCommands.Where(c => ExtractRequiredTypes(c)
|
||||||
.All(t => (bool)method.MakeGenericMethod(t).Invoke(ai.Traits, NoArguments)))
|
.All(t => (bool)method.MakeGenericMethod(t).Invoke(ai, NoArguments)))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,9 +141,9 @@ namespace OpenRA.Mods.Common.AI
|
|||||||
// HACK: HACK HACK HACK
|
// HACK: HACK HACK HACK
|
||||||
// TODO: Derive this from BuildingCommonNames instead
|
// TODO: Derive this from BuildingCommonNames instead
|
||||||
var type = BuildingType.Building;
|
var type = BuildingType.Building;
|
||||||
if (world.Map.Rules.Actors[currentBuilding.Item].Traits.Contains<AttackBaseInfo>())
|
if (world.Map.Rules.Actors[currentBuilding.Item].HasTraitInfo<AttackBaseInfo>())
|
||||||
type = BuildingType.Defense;
|
type = BuildingType.Defense;
|
||||||
else if (world.Map.Rules.Actors[currentBuilding.Item].Traits.Contains<RefineryInfo>())
|
else if (world.Map.Rules.Actors[currentBuilding.Item].HasTraitInfo<RefineryInfo>())
|
||||||
type = BuildingType.Refinery;
|
type = BuildingType.Refinery;
|
||||||
|
|
||||||
var location = ai.ChooseBuildLocation(currentBuilding.Item, true, type);
|
var location = ai.ChooseBuildLocation(currentBuilding.Item, true, type);
|
||||||
|
|||||||
Reference in New Issue
Block a user