From 4bfed9be43a5c48fd1e48f5826b8fc69726d346d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 4 Apr 2010 13:06:04 +1200 Subject: [PATCH] projectile info lookup the same way --- OpenRA.Game/GameRules/WeaponInfo.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index ea2ebfdac1..0fe697e518 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -119,10 +119,7 @@ namespace OpenRA.GameRules // in this case, it's an implementation of IProjectileInfo default: { - var fullTypeName = typeof(IEffect).Namespace + "." + key + "Info"; - Projectile = (IProjectileInfo)typeof(IEffect).Assembly.CreateInstance(fullTypeName); - if (Projectile == null) - throw new InvalidOperationException("Cannot locate projectile type: {0}".F(key)); + Projectile = Game.CreateObject(key + "Info"); FieldLoader.Load(Projectile, kv.Value); } break; }