Jelajahi Sumber

A little more of good practice, thanks Erb

DrHouse 16 tahun lalu
induk
melakukan
c433e26861

+ 2 - 6
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Character.java

@@ -2993,18 +2993,14 @@ public abstract class L2Character extends L2Object
 	/**
 	 * Stop all active skills effects in progress on the L2Character.<BR><BR>
 	 */
-	public final void stopAllEffects()
+	public void stopAllEffects()
 	{
 		_effects.stopAllEffects();
-		if (this instanceof L2PcInstance) ((L2PcInstance)this).updateAndBroadcastStatus(2);
-		if (this instanceof L2Summon) ((L2Summon)this).updateAndBroadcastStatus(1);
  	}
 
-	public final void stopAllEffectsExceptThoseThatLastThroughDeath()
+	public void stopAllEffectsExceptThoseThatLastThroughDeath()
 	{
 		_effects.stopAllEffectsExceptThoseThatLastThroughDeath();
-		if (this instanceof L2PcInstance) ((L2PcInstance)this).updateAndBroadcastStatus(2);
-		if (this instanceof L2Summon) ((L2Summon)this).updateAndBroadcastStatus(1);
 	}
 	
 	/**

+ 14 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Summon.java

@@ -184,6 +184,20 @@ public abstract class L2Summon extends L2Playable
 	// this defines the action buttons, 1 for Summon, 2 for Pets
     public abstract int getSummonType();
 
+	@Override
+	public final void stopAllEffects()
+	{
+		super.stopAllEffects();
+		updateAndBroadcastStatus(1);
+ 	}
+
+	@Override
+	public final void stopAllEffectsExceptThoseThatLastThroughDeath()
+	{
+		super.stopAllEffectsExceptThoseThatLastThroughDeath();
+		updateAndBroadcastStatus(1);
+	}
+    
 	@Override
 	public void updateAbnormalEffect()
     {

+ 13 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -9209,7 +9209,20 @@ public final class L2PcInstance extends L2Playable
 	{
 		return _mountType;
 	}
+	
+	@Override
+	public final void stopAllEffects()
+	{
+		super.stopAllEffects();
+		updateAndBroadcastStatus(2);
+ 	}
 
+	@Override
+	public final void stopAllEffectsExceptThoseThatLastThroughDeath()
+	{
+		super.stopAllEffectsExceptThoseThatLastThroughDeath();
+		updateAndBroadcastStatus(2);
+	}
 	/**
 	 * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
 	 *