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.World)]
|
||||
[Desc("Attach this to the world actor.")]
|
||||
public class CreateMapPlayersInfo : TraitInfo<CreateMapPlayers>, ICreatePlayersInfo
|
||||
{
|
||||
@@ -27,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
/// </summary>
|
||||
void ICreatePlayersInfo.CreateServerPlayers(MapPreview map, Session lobbyInfo, List<GameInformation.Player> players, MersenneTwister playerRandom)
|
||||
{
|
||||
var worldInfo = map.Rules.Actors["world"];
|
||||
var worldInfo = map.Rules.Actors[SystemActors.World];
|
||||
var factions = worldInfo.TraitInfos<FactionInfo>().ToArray();
|
||||
var assignSpawnLocations = worldInfo.TraitInfoOrDefault<IAssignSpawnPointsInfo>();
|
||||
var spawnState = assignSpawnLocations?.InitializeState(map, lobbyInfo);
|
||||
@@ -41,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
// Create the regular playable players.
|
||||
var bots = map.Rules.Actors["player"].TraitInfos<IBotInfo>().ToArray();
|
||||
var bots = map.Rules.Actors[SystemActors.Player].TraitInfos<IBotInfo>().ToArray();
|
||||
|
||||
foreach (var kv in lobbyInfo.Slots)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user