Use name of for exceptions.

This commit is contained in:
Matthias Mailänder
2025-07-21 12:57:40 +02:00
committed by Gustas Kažukauskas
parent a4966bc299
commit 53f959e4bf
4 changed files with 5 additions and 5 deletions

View File

@@ -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); }