浏览代码

* L2JMod: TvTEvent fix, by ratonofx. Fixes #3055
* Little clean

DrHouse 16 年之前
父节点
当前提交
0e4af2546e

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/model/entity/TvTEvent.java

@@ -547,7 +547,7 @@ public class TvTEvent
 	 */
 	public static void onLogout(L2PcInstance playerInstance)
 	{
-		if (playerInstance != null && (isStarting() || isStarted()))
+		if (playerInstance != null && (isStarting() || isStarted() || isParticipating()))
 		{
 			removeParticipant(playerInstance.getObjectId());
 		}

+ 2 - 2
L2_GameServer/java/net/sf/l2j/gameserver/skills/Formulas.java

@@ -1739,7 +1739,6 @@ public final class Formulas
 	/** Returns true if shield defence successful */
 	public boolean calcShldUse(L2Character attacker, L2Character target)
 	{
-		L2Weapon at_weapon = attacker.getActiveWeaponItem();
 		double shldRate = target.calcStat(Stats.SHIELD_RATE, 0, attacker, null)
 			* DEXbonus[target.getDEX()];
 		if (shldRate == 0.0) return false;
@@ -1750,7 +1749,8 @@ public final class Formulas
         }
         // if attacker 
 		// if attacker use bow and target wear shield, shield block rate is multiplied by 1.3 (30%)
-		if (at_weapon != null && at_weapon.getItemType() == L2WeaponType.BOW)
+        L2Weapon at_weapon = attacker.getActiveWeaponItem();
+        if (at_weapon != null && at_weapon.getItemType() == L2WeaponType.BOW)
 			shldRate *= 1.3;
 		return shldRate > Rnd.get(100);
 	}