2
0
Эх сурвалжийг харах

BETA: Misc changes.
* Javadoc typo fix.
* Avoiding custom message when auto learn skill is off.
* Reported by: St3eT

Zoey76 12 жил өмнө
parent
commit
594dfe9501

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/AbstractPlayerGroup.java

@@ -158,7 +158,7 @@ public abstract class AbstractPlayerGroup
 	 * @param procedure to be executed on members, <br>
 	 *            if it returns {@code true}, loop will continue, <br>
 	 *            if it returns {@code false}, loop will break
-	 * @return {@code false} if it was interupted by a {@code false} return of the procedure
+	 * @return {@code false} if it was interrupted by a {@code false} return of the procedure
 	 */
 	public boolean forEachMember(IL2Procedure<L2PcInstance> procedure)
 	{

+ 1 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -6301,12 +6301,7 @@ public abstract class L2Character extends L2Object
 	public int getSkillLevel(int skillId)
 	{
 		final L2Skill skill = getKnownSkill(skillId);
-		if (skill == null)
-		{
-			return -1;
-		}
-		
-		return skill.getLevel();
+		return (skill == null) ? -1 : skill.getLevel();
 	}
 	
 	/**

+ 10 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -3095,10 +3095,10 @@ public final class L2PcInstance extends L2Playable
 	}
 	
 	/**
-	 * Give all available skills to the player.<br>
-	 * @param includedByFs
-	 * @param includeAutoGet
-	 * @return skillCounter, the amount of new skills added.
+	 * Give all available skills to the player.
+	 * @param includedByFs if {@code true} forgotten scroll skills present in the skill tree will be added
+	 * @param includeAutoGet if {@code true} auto-get skills present in the skill tree will be added
+	 * @return the amount of new skills earned
 	 */
 	public int giveAvailableSkills(boolean includedByFs, boolean includeAutoGet)
 	{
@@ -3141,12 +3141,15 @@ public final class L2PcInstance extends L2Playable
 			skills = SkillTreesData.getInstance().getAvailableSkills(this, getClassId(), includedByFs, includeAutoGet);
 		}
 		
-		sendMessage("You have learned " + skillCounter + " new skills.");
+		if (Config.AUTO_LEARN_SKILLS && (skillCounter > 0))
+		{
+			sendMessage("You have earned " + skillCounter + " new skills.");
+		}
 		return skillCounter;
 	}
 	
 	/**
-	 * Give all available AutoGet skills to the player.
+	 * Give all available auto-get skills to the player.
 	 */
 	public void giveAvailableAutoGetSkills()
 	{
@@ -3163,7 +3166,7 @@ public final class L2PcInstance extends L2Playable
 			}
 			else
 			{
-				_log.warning("Skipping null autoGet Skill for player: " + this);
+				_log.warning("Skipping null auto-get skill for player: " + toString());
 			}
 		}
 	}