Add a lint check for trait placement on hardcoded actor names.

This commit is contained in:
Matthias Mailänder
2021-04-11 14:30:00 +01:00
committed by reaperrr
parent 0d3c624bbc
commit 5a0bcc01a6
129 changed files with 266 additions and 67 deletions

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
[Desc("Displays custom terrain types.")]
class CustomTerrainDebugOverlayInfo : TraitInfo
{

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Render
// No queues available - check for classic production queues
if (queue == null)
queue = rules.Actors["player"].TraitInfos<ProductionQueueInfo>().FirstOrDefault(q => ProductionType == q.Type);
queue = rules.Actors[SystemActors.Player].TraitInfos<ProductionQueueInfo>().FirstOrDefault(q => ProductionType == q.Type);
if (queue == null)
throw new YamlException("Can't find a queue with ProductionType '{0}'".F(ProductionType));

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[TraitLocation(SystemActors.Player)]
[Desc("Attach this to the player actor. When attached, enables all actors possessing the ProducibleWithLevel ",
"trait to have their production queue icons render with an overlay defined in this trait. ",
"The icon change occurs when ProducibleWithLevel.Prerequisites are met.")]