Change to use pattern matching

This commit is contained in:
teinarss
2021-02-28 19:00:32 +01:00
committed by reaperrr
parent 7c0e4b25ae
commit d60c05eff3
35 changed files with 63 additions and 122 deletions

View File

@@ -21,9 +21,8 @@ namespace OpenRA.Mods.Common.Lint
foreach (var weaponInfo in rules.Weapons)
{
var range = weaponInfo.Value.Range;
var missile = weaponInfo.Value.Projectile as MissileInfo;
if (missile != null && missile.RangeLimit > WDist.Zero && missile.RangeLimit < range)
if (weaponInfo.Value.Projectile is MissileInfo missile && missile.RangeLimit > WDist.Zero && missile.RangeLimit < range)
emitError("Weapon `{0}`: projectile RangeLimit lower than weapon range!"
.F(weaponInfo.Key));
}