mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Mail.git
synced 2026-11-07 04:48:58 +00:00
0.1.156: Brief an Absender zurueck; Codex-Datenbank ohne langes Einfrieren (Item-Werte in Zeitscheiben)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
@@ -233,12 +233,13 @@ function Mail.ReadInbox()
|
||||
n = (ok and tonumber(n)) or 0
|
||||
local seen = {}
|
||||
for i = 1, n do
|
||||
local ok1, _, _, sender, subject, money, cod, days, hasItem, wasRead = pcall(GetInboxHeaderInfo, i)
|
||||
local ok1, _, _, sender, subject, money, cod, days, hasItem, wasRead, wasReturned, _, canReply = pcall(GetInboxHeaderInfo, i)
|
||||
if ok1 then
|
||||
local m = {
|
||||
i = i, sender = sender or "?", subject = subject or "",
|
||||
money = tonumber(money) or 0, cod = tonumber(cod) or 0, days = tonumber(days),
|
||||
hasItem = (hasItem and hasItem ~= 0) and true or false, read = wasRead and true or false,
|
||||
returned = wasReturned and true or false, canReply = not (canReply == false or canReply == 0),
|
||||
}
|
||||
if m.hasItem and GetInboxItem then
|
||||
local ok2, name, tex, count = pcall(GetInboxItem, i)
|
||||
@@ -359,6 +360,24 @@ function Mail:RemoveMail(m)
|
||||
return true, own and "own" or "archived"
|
||||
end
|
||||
|
||||
-- Brief an den Absender zurueckschicken (Anhang und Gold gehen mit zurueck). Nicht moeglich bei System-/Auktionsbriefen.
|
||||
function Mail.Returnable(m)
|
||||
if not m or not m.canReply or m.returned then return false end
|
||||
local s = tostring(m.sender or "")
|
||||
if s == "" or s == "?" or Mail.IsSelf(s) then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
function Mail:ReturnMail(m)
|
||||
if self.busy then return false, "busy" end
|
||||
if not Mail.Returnable(m) then return false, "noreturn" end
|
||||
if not ReturnInboxItem then return false, "noreturn" end
|
||||
local ok = pcall(ReturnInboxItem, m.i)
|
||||
if not ok then return false, "noreturn" end
|
||||
Mail.taken[Pair(m)] = nil
|
||||
return true
|
||||
end
|
||||
|
||||
function Mail:FindMail(key, pair)
|
||||
local list = Mail.ReadInbox()
|
||||
for _, m in ipairs(list) do
|
||||
|
||||
Reference in New Issue
Block a user