Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit cc1338f

Browse files
committed
More warning fixes.
1 parent d4d6a57 commit cc1338f

1 file changed

Lines changed: 26 additions & 50 deletions

File tree

Core.lua

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,7 @@ function oq.get_ad_text()
37923792
if (bg == nil) then
37933793
bg = 'BG'
37943794
end
3795-
local aText = ''
3795+
local aText
37963796
local hText = ''
37973797
local line1 = ''
37983798
if (AlwaysUpFrame1Text ~= nil) then
@@ -4446,7 +4446,6 @@ function oq.BNSendQ_push(func_, pid_, msg_, name_, realm_)
44464446
-- bundle full. cut it lose, set it to be deleted and create a new one for overflow
44474447
t.ok2delete = 1 -- must already be queue'd up. pop will delete it
44484448
oq._bundles[pid_] = tbl.new()
4449-
t = oq._bundles[pid_]
44504449
return
44514450
end
44524451

@@ -4673,8 +4672,6 @@ function oq.crack_bn_msg(msg)
46734672
realm = oq.GetRealmNameFromID(realm)
46744673
from = oq.get_field(msg, OQ_FLD_FROM)
46754674

4676-
local from_name, from_realm = oq.crack_name(from)
4677-
from_realm = oq.GetRealmNameFromID(from_realm)
46784675
return m, name, realm, from
46794676
end
46804677

@@ -4686,10 +4683,6 @@ function oq.WhisperPartyLeader(msg)
46864683
return
46874684
end
46884685
local lead = oq.raid.group[my_group].member[1]
4689-
local name = lead.name
4690-
if (lead.realm ~= player_realm) then
4691-
name = name .. '-' .. lead.realm
4692-
end
46934686

46944687
-- TODO test whether XRealmWhisper or SendAddonMessage would be better
46954688
-- oq.SendAddonMessage(OQ_HEADER, msg, "WHISPER", name)
@@ -7013,10 +7006,6 @@ function oq.group_invite_slot(req_token, group_id, slot)
70137006

70147007
-- the 'W' stands for 'whisper' and should not be echo'd far and wide
70157008
local msg_tok = 'W' .. oq.token_gen()
7016-
local g_leader_rid = oq.raid.group[group_id].member[1].realid
7017-
if (g_leader_rid == nil) then
7018-
g_leader_rid = OQ_NOEMAIL
7019-
end
70207009

70217010
oq.token_push(msg_tok)
70227011
local enc_data = oq.encode_data('abc123', oq.raid.leader, oq.raid.leader_realm, oq.raid.leader_rid)
@@ -7184,9 +7173,9 @@ function oq.btag_link3(desc, name_realm, btag)
71847173
return str
71857174
end
71867175

7187-
function oq.on_btag(name, realm_id, rid, stats)
7176+
function oq.on_btag(name, _, rid, stats)
71887177
_ok2relay = 1
7189-
realm_id = tonumber(realm_id)
7178+
71907179
local g, s = oq.find_members_seat(oq.raid.group, name)
71917180
if (g) then
71927181
local p = oq.raid.group[g].member[s]
@@ -7761,7 +7750,7 @@ function oq.create_group(parent, x, y, cx, cy, _, title, group_id)
77617750
f.lag:SetJustifyH('RIGHT')
77627751

77637752
f.slots = tbl.new()
7764-
local cx = cy - 2 * 2 -- to make them square
7753+
cx = cy - 2 * 2 -- to make them square
77657754

77667755
for i = 1, 5 do
77677756
f.slots[i] = oq.create_class_dot(f, 255 + 5 + (cx + 4) * (i - 1), 2, cx, cy - 2 * 2)
@@ -7839,7 +7828,7 @@ function oq.create_scenario_group(parent, x, y, ix, iy, _, title, group_id)
78397828

78407829
f.gid = oq.label(f, 2, 2, 16, cy - 8, title)
78417830
f.slots = tbl.new()
7842-
local x = 10
7831+
x = 10
78437832

78447833
x = x + cx + 10 -- bump ahead one panel to center it
78457834
for i = 1, 3 do
@@ -7852,7 +7841,7 @@ function oq.create_scenario_group(parent, x, y, ix, iy, _, title, group_id)
78527841
return f
78537842
end
78547843

7855-
function oq.create_arena_group(parent, x_, y_, ix, iy, label_cx, title, group_id)
7844+
function oq.create_arena_group(parent, x_, y_, ix, iy, _, title, group_id)
78567845
oq.nthings = (oq.nthings or 0) + 1
78577846
local n = 'ArenaRegion'
78587847
local f = oq.panel(parent, n, x_, y_, ix, iy)
@@ -8172,7 +8161,7 @@ function oq.remove_wayward_rows()
81728161
end
81738162
end
81748163

8175-
function oq.create_premade_listing(parent, x, y, cx, cy, token, type)
8164+
function oq.create_premade_listing(parent, x, y, cx, cy, token)
81768165
local r = oq.premades[token]
81778166
if (r == nil) then
81788167
return
@@ -8212,7 +8201,7 @@ function oq.create_premade_listing(parent, x, y, cx, cy, token, type)
82128201
f.voip = f.voip or f:CreateTexture(nil, 'OVERLAY')
82138202
oq.setpos(f.voip, x2, 2, 18, 18)
82148203
f.voip:SetAlpha(0.8)
8215-
f.voip:SetTexture(OQ.VOIP_ICON[VOIP_UNSPECIFIED])
8204+
f.voip:SetTexture(OQ.VOIP_ICON[OQ.VOIP_UNSPECIFIED])
82168205
x2 = x2 + 20 + 2
82178206

82188207
f.lang = f.lang or f:CreateTexture(nil, 'OVERLAY')
@@ -9129,7 +9118,7 @@ function oq.create_log_button(parent)
91299118
)
91309119
b:Show()
91319120

9132-
local ht = b:CreateTexture()
9121+
ht = b:CreateTexture()
91339122
ht:SetTexture([[Interface\Buttons\ButtonHilight-Square]])
91349123
ht:SetAllPoints(b)
91359124
b:SetHighlightTexture(ht)
@@ -10106,7 +10095,6 @@ function oq.create_tab1_common(parent)
1010610095
)
1010710096

1010810097
-- lucky charms
10109-
y = y + 30
1011010098
oq.tab1._lucky_charms =
1011110099
oq.button(
1011210100
parent,
@@ -11020,7 +11008,7 @@ function oq.premade_row_show(p)
1102011008
p.raid_token,
1102111009
p.type
1102211010
)
11023-
oq.on_premade_stats(p.raid_token, p.nMembers, 1, p.tm, p.status, p.nWaiting, p.type, p.subtype)
11011+
oq.on_premade_stats(p.raid_token, p.nMembers, 1, p.tm, p.status, p.nWaiting)
1102411012
oq.update_premade_listitem(
1102511013
p.raid_token,
1102611014
p.name,
@@ -11418,7 +11406,6 @@ function oq.create_tab3()
1141811406
oq.tab3_notes:SetText(OQ.DEFAULT_PREMADE_TEXT)
1141911407

1142011408
oq.tab3_pword = oq.editline(OQTabPage3, 'password', x, y, cx, cy, 10)
11421-
y = y + cy + 6
1142211409

1142311410
oq.tab3_faction = oq.player_faction
1142411411
oq.tab3_channel_pword = 'p' .. oq.token_gen() -- no reason for the leader to set password. just auto generate
@@ -12556,7 +12543,6 @@ function oq.create_tab_setup()
1255612543
parent:SetScript(
1255712544
'OnHide',
1255812545
function()
12559-
oq.onhide_tab_setup()
1256012546
end
1256112547
)
1256212548
x = 20
@@ -13015,13 +13001,6 @@ function oq.populate_tab_setup()
1301513001
oq.calc_pkt_stats()
1301613002
end
1301713003

13018-
function oq.onhide_tab_setup()
13019-
end
13020-
13021-
function oq.is_my_req_token(req_tok)
13022-
return oq.token_was_seen(req_tok)
13023-
end
13024-
1302513004
function oq.on_disband(raid_tok, token, local_override)
1302613005
if (oq.iam_raid_leader()) and (oq.raid.raid_token == raid_tok) and (oq._local == nil) then
1302713006
_ok2relay = nil
@@ -13823,10 +13802,6 @@ function oq.on_ping_ack(token, ts, g_id)
1382313802
for i, grp in pairs(oq.raid.group) do
1382413803
if ((grp.member[1].name) and (grp.member[1].name ~= '') and (grp.member[1].name ~= '-')) then
1382513804
local m = grp.member[1]
13826-
local n = m.name
13827-
if (m.realm ~= player_realm) then
13828-
n = n .. '-' .. m.realm
13829-
end
1383013805
if (m.name == oq._sender) then
1383113806
grp._last_ping = oq.utc_time()
1383213807
m.lag = lag
@@ -14436,7 +14411,7 @@ function oq.process_premade_info(
1443614411
end
1443714412
premade.has_pword = has_pword
1443814413
premade.is_realm_specific = is_realm_specific
14439-
oq.on_premade_stats(raid_tok, nMem, is_source, tm_, status_, nWait, type_, subtype_)
14414+
oq.on_premade_stats(raid_tok, nMem, is_source, tm_, status_, nWait)
1444014415
oq.update_premade_listitem(
1444114416
raid_tok,
1444214417
raid_name,
@@ -14496,7 +14471,7 @@ function oq.process_premade_info(
1449614471

1449714472
npremades = npremades + 1
1449814473

14499-
oq.on_premade_stats(raid_tok, nMem, is_source, tm_, status_, nWait, type_, subtype_)
14474+
oq.on_premade_stats(raid_tok, nMem, is_source, tm_, status_, nWait)
1450014475
oq.update_premade_listitem(
1450114476
raid_tok,
1450214477
raid_name,
@@ -14520,7 +14495,7 @@ function oq.process_premade_info(
1452014495
local rc = oq.announce_new_premade(raid_name, nil, raid_tok)
1452114496
end
1452214497

14523-
function oq.on_premade_stats(raid_token, nMem, is_source, tm, status, nWait, type_, subtype_)
14498+
function oq.on_premade_stats(raid_token, nMem, is_source, tm, status, nWait)
1452414499
_ok2relay = 'bnet' -- should only bounce to bn-friends and oqgeneral, if raid-leader not on realm and msg never seen
1452514500
local raid = oq.premades[raid_token]
1452614501
if (raid == nil) then
@@ -20078,15 +20053,16 @@ function oq.XRealmWhisper(receiverName, receiverRealm, msg)
2007820053

2007920054
oq.SendChatMessage(msg, 'WHISPER', nil, receiverName .. '-' .. receiverRealm)
2008020055
end
20081-
-- function oq.debug(msg, ...)
20082-
-- if type(msg) == "table" then
20083-
-- for k, v in pairs(msg) do
20084-
-- print("KEY")
20085-
-- print(k)
20086-
-- oq.debug(v)
20087-
-- end
20088-
-- else
20089-
-- print("VAL")
20090-
-- print(msg)
20091-
-- end
20092-
-- end
20056+
20057+
function oq.debug(msg)
20058+
if type(msg) == "table" then
20059+
for k, v in pairs(msg) do
20060+
print("KEY")
20061+
print(k)
20062+
oq.debug(v)
20063+
end
20064+
else
20065+
print("VAL")
20066+
print(msg)
20067+
end
20068+
end

0 commit comments

Comments
 (0)