Add a lint check for trait placement on hardcoded actor names.
This commit is contained in:
committed by
reaperrr
parent
0d3c624bbc
commit
5a0bcc01a6
@@ -18,6 +18,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TraitLocation(SystemActors.EditorWorld)]
|
||||
[Desc("Required for the map editor to work. Attach this to the world actor.")]
|
||||
public class EditorResourceLayerInfo : TraitInfo, IResourceLayerInfo, IMapPreviewSignatureInfo
|
||||
{
|
||||
@@ -94,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (w.Type != WorldType.Editor)
|
||||
return;
|
||||
|
||||
var playerResourcesInfo = w.Map.Rules.Actors["player"].TraitInfoOrDefault<PlayerResourcesInfo>();
|
||||
var playerResourcesInfo = w.Map.Rules.Actors[SystemActors.Player].TraitInfoOrDefault<PlayerResourcesInfo>();
|
||||
resourceValues = playerResourcesInfo?.ResourceValues ?? new Dictionary<string, int>();
|
||||
|
||||
foreach (var cell in Map.AllCells)
|
||||
|
||||
Reference in New Issue
Block a user