浏览代码

Fixes #1257

* Not the Owner should be Betrayed, the Summon should be.
nBd 17 年之前
父节点
当前提交
de3365f315

+ 2 - 2
L2_GameServer_T1/java/net/sf/l2j/gameserver/clientpackets/RequestActionUse.java

@@ -184,14 +184,14 @@ public final class RequestActionUse extends L2GameClientPacket
                 
                 break;
             case 19: // pet unsummon
-                if (pet != null && !activeChar.isBetrayed())
+                if (pet != null)
                 {
                     //returns pet to control item
                     if (pet.isDead())
                     {
                         activeChar.sendPacket(new SystemMessage(SystemMessageId.DEAD_PET_CANNOT_BE_RETURNED));
                     }
-                    else if (pet.isAttackingNow() || pet.isRooted())
+                    else if (pet.isAttackingNow() || pet.isRooted() || pet.isBetrayed())
                     {
                         activeChar.sendPacket(new SystemMessage(SystemMessageId.PET_CANNOT_SENT_BACK_DURING_BATTLE));
                     }

+ 8 - 11
L2_GameServer_T1/java/net/sf/l2j/gameserver/skills/effects/EffectBetray.java

@@ -42,25 +42,22 @@ final class EffectBetray extends L2Effect
     @Override
     public void onStart()
     {
-        if ( getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
+        if (getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
         {
-            L2PcInstance targetOwner = null;
-            targetOwner = ((L2Summon)getEffected()).getOwner();
-            getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,targetOwner);
-            targetOwner.setIsBetrayed(true);
+            getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, ((L2Summon)getEffected()).getOwner());
+            getEffected().setIsBetrayed(true);
             onActionTime();
         }
-        }
+    }
+    
      /** Notify exited */
     @Override
     public void onExit()
     {
-        if ( getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
+        if (getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
         {
-            L2PcInstance targetOwner = null;
-            targetOwner = ((L2Summon)getEffected()).getOwner();
-            targetOwner.setIsBetrayed(false);
-        getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+        	getEffected().setIsBetrayed(false);
+        	getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
         }
     }