comparison Main.lua @ 334:5bc69e705add WoD

Globals cleanup.
author James D. Callahan III <jcallahan@curse.com>
date Tue, 26 Aug 2014 11:20:13 -0500
parents 601d3e517460
children cba0e57a71b7
comparison
equal deleted inserted replaced
333:601d3e517460 334:5bc69e705add
8 8
9 local bit = _G.bit 9 local bit = _G.bit
10 local math = _G.math 10 local math = _G.math
11 local table = _G.table 11 local table = _G.table
12 12
13 local next = _G.next
13 local select = _G.select 14 local select = _G.select
14 local unpack = _G.unpack 15 local unpack = _G.unpack
15 16
16 17
17 -- ADDON NAMESPACE ---------------------------------------------------- 18 -- ADDON NAMESPACE ----------------------------------------------------
463 local NPC_ID_MAPPING = { 464 local NPC_ID_MAPPING = {
464 [62164] = 63191, -- Garalon 465 [62164] = 63191, -- Garalon
465 } 466 }
466 467
467 468
468 function MatchUnitTypes(unit_type_name) 469 local function MatchUnitTypes(unit_type_name)
469 if not unit_type_name then 470 if not unit_type_name then
470 return UNIT_TYPES.UNKNOWN 471 return UNIT_TYPES.UNKNOWN
471 end 472 end
472 473
473 for def, text in next, UNIT_TYPES do 474 for def, text in next, UNIT_TYPES do
485 end 486 end
486 487
487 -- We might want to use some of this new information later, but leaving the returns alone for now 488 -- We might want to use some of this new information later, but leaving the returns alone for now
488 local unit_type_name, unk_id1, server_id, instance_id, unk_id2, unit_idnum, spawn_id = (":"):split(guid) 489 local unit_type_name, unk_id1, server_id, instance_id, unk_id2, unit_idnum, spawn_id = (":"):split(guid)
489 490
490 unit_type = MatchUnitTypes(unit_type_name) 491 local unit_type = MatchUnitTypes(unit_type_name)
491 if unit_type ~= UNIT_TYPES.PLAYER and unit_type ~= UNIT_TYPES.PET and unit_type ~= UNIT_TYPES.ITEM then 492 if unit_type ~= UNIT_TYPES.PLAYER and unit_type ~= UNIT_TYPES.PET and unit_type ~= UNIT_TYPES.ITEM then
492 493
493 local id_mapping = NPC_ID_MAPPING[unit_idnum] 494 local id_mapping = NPC_ID_MAPPING[unit_idnum]
494 495
495 if id_mapping and UnitTypeIsNPC(unit_type) then 496 if id_mapping and UnitTypeIsNPC(unit_type) then