浏览代码

BETA: Fixing minor typo in My Teleports feature causing critical errors when adding locations.
* Reported by: CostyKiller, pandragon, Zoey76
* Patch by: Tukune
* Tested by: CostyKiller

Rumen Nikiforov 11 年之前
父节点
当前提交
96bc8c24c4
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

+ 9 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -13303,7 +13303,7 @@ public final class L2PcInstance extends L2Playable
 	
 	public void teleportBookmarkModify(int id, int icon, String tag, String name)
 	{
-		TeleportBookmark bookmark = _tpbookmarks.get(id);
+		final TeleportBookmark bookmark = _tpbookmarks.get(id);
 		if (bookmark != null)
 		{
 			bookmark.setIcon(icon);
@@ -13465,7 +13465,14 @@ public final class L2PcInstance extends L2Playable
 			return;
 		}
 		
-		int id = _tpbookmarks.size();
+		int id;
+		for (id = 1; id <= _bookmarkslot; ++id)
+		{
+			if (!_tpbookmarks.containsKey(id))
+			{
+				break;
+			}
+		}
 		_tpbookmarks.put(id, new TeleportBookmark(id, x, y, z, icon, tag, name));
 		
 		destroyItem("Consume", getInventory().getItemByItemId(20033).getObjectId(), 1, null, false);