projectile info lookup the same way

This commit is contained in:
Chris Forbes
2010-04-04 13:06:04 +12:00
parent 3d0b0dc82b
commit 4bfed9be43

View File

@@ -119,10 +119,7 @@ namespace OpenRA.GameRules
// in this case, it's an implementation of IProjectileInfo // in this case, it's an implementation of IProjectileInfo
default: default:
{ {
var fullTypeName = typeof(IEffect).Namespace + "." + key + "Info"; Projectile = Game.CreateObject<IProjectileInfo>(key + "Info");
Projectile = (IProjectileInfo)typeof(IEffect).Assembly.CreateInstance(fullTypeName);
if (Projectile == null)
throw new InvalidOperationException("Cannot locate projectile type: {0}".F(key));
FieldLoader.Load(Projectile, kv.Value); FieldLoader.Load(Projectile, kv.Value);
} break; } break;
} }