comparison Main.lua @ 215:3b04818b4c03

Rename PlayerTarget() to TargetedNPC()
author James D. Callahan III <jcallahan@curse.com>
date Tue, 22 Jan 2013 12:23:35 -0600
parents 9b0333c7513e
children 1af96c9a930e
comparison
equal deleted inserted replaced
214:9b0333c7513e 215:3b04818b4c03
870 end 870 end
871 end 871 end
872 end 872 end
873 873
874 874
875 local PlayerTarget 875 local TargetedNPC
876 do 876 do
877 local GENDER_NAMES = { 877 local GENDER_NAMES = {
878 "UNKNOWN", 878 "UNKNOWN",
879 "MALE", 879 "MALE",
880 "FEMALE", 880 "FEMALE",
900 ["3"] = "ENERGY", 900 ["3"] = "ENERGY",
901 ["6"] = "RUNIC_POWER", 901 ["6"] = "RUNIC_POWER",
902 } 902 }
903 903
904 904
905 function PlayerTarget() 905 function TargetedNPC()
906 if not _G.UnitExists("target") or _G.UnitPlayerControlled("target") or currently_drunk then 906 if not _G.UnitExists("target") or _G.UnitPlayerControlled("target") or currently_drunk then
907 current_target_id = nil 907 current_target_id = nil
908 return 908 return
909 end 909 end
910 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target")) 910 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target"))
955 for index = 1, 4 do 955 for index = 1, 4 do
956 if not _G.CheckInteractDistance("target", index) then 956 if not _G.CheckInteractDistance("target", index) then
957 return 957 return
958 end 958 end
959 end 959 end
960 local npc = PlayerTarget() 960 local npc = TargetedNPC()
961 961
962 if not npc then 962 if not npc then
963 return 963 return
964 end 964 end
965 local zone_name, area_id, x, y, map_level, difficulty_token = CurrentLocationData() 965 local zone_name, area_id, x, y, map_level, difficulty_token = CurrentLocationData()
1820 end 1820 end
1821 end 1821 end
1822 1822
1823 1823
1824 function WDP:PLAYER_TARGET_CHANGED(event_name) 1824 function WDP:PLAYER_TARGET_CHANGED(event_name)
1825 if not PlayerTarget() then 1825 if not TargetedNPC() then
1826 return 1826 return
1827 end 1827 end
1828 current_action.target_type = AF.NPC 1828 current_action.target_type = AF.NPC
1829 self:UpdateTargetLocation() 1829 self:UpdateTargetLocation()
1830 end 1830 end