Fix projectiles to use IRulesetLoaded properly

This commit is contained in:
Voidwalker
2018-04-17 13:00:19 +02:00
committed by reaperrr
parent f0e190825a
commit 0c30a1d670

View File

@@ -67,6 +67,19 @@ namespace OpenRA
foreach (var weapon in Weapons) foreach (var weapon in Weapons)
{ {
var projectileLoaded = weapon.Value.Projectile as IRulesetLoaded<WeaponInfo>;
if (projectileLoaded != null)
{
try
{
projectileLoaded.RulesetLoaded(this, weapon.Value);
}
catch (YamlException e)
{
throw new YamlException("Projectile type {0}: {1}".F(weapon.Key, e.Message));
}
}
foreach (var warhead in weapon.Value.Warheads) foreach (var warhead in weapon.Value.Warheads)
{ {
var cacher = warhead as IRulesetLoaded<WeaponInfo>; var cacher = warhead as IRulesetLoaded<WeaponInfo>;