Browse Source

Reflect call fix, thx Lupu1

BiggBoss 13 years ago
parent
commit
02d49c2b73

+ 4 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/templates/effects/EffectTemplate.java

@@ -142,18 +142,12 @@ public class EffectTemplate
 	 */
 	public L2Effect getStolenEffect(Env env, L2Effect stolen)
 	{
-		Class<?> func;
+		Class<?> func = EffectHandler.getInstance().getHandler(funcName);
+		if(func == null)
+			throw new RuntimeException();
+		
 		Constructor<?> stolenCons;
 		try
-		{
-			func = Class.forName("com.l2jserver.gameserver.skills.effects.Effect"
-					+ stolen.getEffectTemplate().funcName);
-		}
-		catch (ClassNotFoundException e)
-		{
-			throw new RuntimeException(e);
-		}
-		try
 		{
 			stolenCons = func.getConstructor(Env.class, L2Effect.class);
 		}