Use name of for exceptions.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
a4966bc299
commit
53f959e4bf
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
{
|
||||
if (!rules.Actors[SystemActors.World].HasTraitInfo<TerrainLightingInfo>())
|
||||
throw new YamlException("TerrainLightSource can only be used with the world TerrainLighting trait.");
|
||||
throw new YamlException($"{nameof(TerrainLightSource)} can only be used with the world {nameof(TerrainLighting)} trait.");
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TerrainLightSource(init.Self, this); }
|
||||
|
||||
Reference in New Issue
Block a user