Code:
From dba6a5c03a1d931fbb3295d6c8b3798fd78545c6 Mon Sep 17 00:00:00 2001
From: Kaboca
Date: Sun, 8 Sep 2013 10:04:02 +0200
Subject: [PATCH] Fix Notes Recording
---
Carbonite.Notes/NxFav.lua | 13 ++++---------
Carbonite/NxMap.lua | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/Carbonite.Notes/NxFav.lua b/Carbonite.Notes/NxFav.lua
index 822b44f..adea9f2 100644
--- a/Carbonite.Notes/NxFav.lua
+++ b/Carbonite.Notes/NxFav.lua
@@ -1054,13 +1054,8 @@ function Nx.Notes:ParseItemNote (data)
end
function Nx.Notes:ParseItemTarget (data)
-
- local zone = tonumber (strsub (data, 1, 2), 16)
- local id = Nx.NxzoneToMapId[zone]
- local x = tonumber (strsub (data, 3, 5), 16) / 4090 * 100
- local y = tonumber (strsub (data, 6, 8), 16) / 4090 * 100
- local dLvl = (strbyte (data, 9) or 35) - 35
- return id, x, y + dLvl * 100
+ local zone,x,y = Nx.Split("|",data)
+ return tonumber(zone), tonumber(x), tonumber(y)
end
function Nx.Notes:GetItemTypeName (index)
@@ -1152,7 +1147,7 @@ function Nx.Notes:Record (typ, name, id, x, y)
local fav = self.Recording
if fav then
- local s = self:CreateItem ("T", 0, name, self.RecId, self.RecX, self.RecY)
+ local s = self:CreateItem ("T", 0, name, 2,self.RecId, self.RecX, self.RecY)
self:AddItem (fav, self.CurItemI, s)
self:Update()
end
@@ -1161,7 +1156,7 @@ function Nx.Notes:Record (typ, name, id, x, y)
local fav = self.Recording
if fav then
- local s = self:CreateItem ("t", 0, name, self.RecId, self.RecX, self.RecY)
+ local s = self:CreateItem ("t", 0, name, 3,self.RecId, self.RecX, self.RecY)
self:AddItem (fav, self.CurItemI, s)
self:Update()
end
diff --git a/Carbonite/NxMap.lua b/Carbonite/NxMap.lua
index 3254575..4002bd3 100644
--- a/Carbonite/NxMap.lua
+++ b/Carbonite/NxMap.lua
@@ -9320,7 +9320,7 @@ function Nx.Map:SetTarget (typ, x1, y1, x2, y2, tex, id, name, keep, mapId)
local typ = keep and "Target" or "TargetS"
local zx, zy = self:GetZonePos (mapId, tar.TargetMX, tar.TargetMY)
--- Nx.Notes:Record (typ, name, mapId, zx, zy)
+ Nx.Notes:Record (typ, name, mapId, zx, zy)
return tar
end
--
1.8.3.msysgit.0