Răsfoiți Sursa

Potion Bug - When you target a distant mob and click on a skill, the char starts to run directly to the mob (fine here) but if you use a potion while running your char stops running to the target (wrong here)
,,,(Thanks House for the fix, and thanks Poltomb for testing it),,,

Ahmed 17 ani în urmă
părinte
comite
b823f7a98a

+ 4 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -5941,6 +5941,10 @@ public abstract class L2Character extends L2Object
         {
             L2PcInstance currPlayer = (L2PcInstance)this;
             SkillDat queuedSkill = currPlayer.getQueuedSkill();
+            
+         // Rescuing old skill cast task if exist
+         if (skill.isPotion())
+        	 queuedSkill = currPlayer.getCurrentSkill();
 
             currPlayer.setCurrentSkill(null, false, false);
 

+ 5 - 2
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -8048,8 +8048,11 @@ public final class L2PcInstance extends L2PlayableInstance
         	}
         }
 
-        // If all conditions are checked, create a new SkillDat object and set the player _currentSkill
-        setCurrentSkill(skill, forceUse, dontMove);
+       /* If all conditions are checked, create a new SkillDat object and set the player _currentSkill
+        * If skill is potion, do not save data into _currentSkill so that previous casting
+        * intention can be easily retaken later
+        */
+        if (!skill.isPotion()) setCurrentSkill(skill, forceUse, dontMove);
 
 		// Check if the active L2Skill can be casted (ex : not sleeping...), Check if the target is correct and Notify the AI with AI_INTENTION_CAST and target
         super.useMagic(skill);