Bläddra i källkod

BETA: Minor effect fix:
* When removing effects they shouldn't be set as not in use in effect list.
* Reported by: nBd
* Reviewed by: nBd
* Removing a couple of useless effect types.
* Making onActionTime() method non-abstract, it returns false by default.

Zoey76 12 år sedan
förälder
incheckning
d845304228

+ 2 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/CharEffectList.java

@@ -648,6 +648,7 @@ public final class CharEffectList
 				if (effect.setInUse(false))
 				{
 					_owner.removeStatsOwner(effect);
+					
 					if (_passives != null)
 					{
 						_passives.remove(effect);
@@ -666,10 +667,7 @@ public final class CharEffectList
 		// Remove the effect from character effects.
 		for (L2Effect effect : effects)
 		{
-			if (effect.setInUse(false))
-			{
-				_owner.removeStatsOwner(effect);
-			}
+			_owner.removeStatsOwner(effect);
 			
 			effectList.remove(effect);
 			

+ 7 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/effects/L2Effect.java

@@ -367,9 +367,13 @@ public abstract class L2Effect implements IChanceSkillTrigger
 	}
 	
 	/**
-	 * @return true for continuation of this effect
+	 * Method called on each tick.
+	 * @return {@code true} for continuation of this effect, {@code false} otherwise
 	 */
-	public abstract boolean onActionTime();
+	public boolean onActionTime()
+	{
+		return false;
+	}
 	
 	public final void scheduleEffect()
 	{
@@ -471,7 +475,7 @@ public abstract class L2Effect implements IChanceSkillTrigger
 		env.setSkill(_skill);
 		for (FuncTemplate t : _template.getFuncTemplates())
 		{
-			Func f = t.getFunc(env, this); // effect is owner
+			final Func f = t.getFunc(env, this);
 			if (f != null)
 			{
 				funcs.add(f);

+ 0 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/effects/L2EffectType.java

@@ -54,7 +54,6 @@ public enum L2EffectType
 	FOCUS_SOULS,
 	FUSION,
 	GIVE_SP,
-	HARVESTING,
 	HEAL,
 	HEAL_OVER_TIME,
 	HEAL_PERCENT,
@@ -86,7 +85,6 @@ public enum L2EffectType
 	REBALANCE_HP,
 	RELAXING,
 	REMOVE_TARGET,
-	RESTORATION_RANDOM,
 	ROOT,
 	SIGNET_EFFECT,
 	SIGNET_GROUND,