Unhardcode defenses in BaseBuilderBotModule

This commit is contained in:
dnqbob
2022-07-30 20:34:33 +08:00
committed by abcdefg30
parent e8748200f7
commit 013ec52108
6 changed files with 15 additions and 1 deletions

View File

@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Traits
else
{
// Check if Building is a defense and if we should place it towards the enemy or not.
if (actorInfo.HasTraitInfo<AttackBaseInfo>() && world.LocalRandom.Next(100) < baseBuilder.Info.PlaceDefenseTowardsEnemyChance)
if (baseBuilder.Info.DefenseTypes.Contains(actorInfo.Name) && world.LocalRandom.Next(100) < baseBuilder.Info.PlaceDefenseTowardsEnemyChance)
type = BuildingType.Defense;
else if (baseBuilder.Info.RefineryTypes.Contains(actorInfo.Name))
type = BuildingType.Refinery;