comparison location_cache.lua @ 18:6cdb9377585b v1.01

Location Cache Update
author Aaron@Aaron-PC
date Thu, 19 Aug 2010 17:23:57 -0500
parents 22686cb65c51
children bdd440ac55be
comparison
equal deleted inserted replaced
17:22686cb65c51 18:6cdb9377585b
51 ["y"] = 0.2445829063653946, 51 ["y"] = 0.2445829063653946,
52 ["x"] = 0.5585364103317261, 52 ["x"] = 0.5585364103317261,
53 }, 53 },
54 } 54 }
55 55
56 local function fix_coords(note) 56 --[[
57 for name, coord in pairs(RECIPEPROFIT_location_cache) do 57 Replaces the X and Y coordinates in the coordinate cached database.
58 ]]
59 local function fix_coords(note, cdb)
60 for name, coord in pairs(cdb) do
58 if(note.vendor == name) then 61 if(note.vendor == name) then
59 note.x = coord.x * 100 62 note.x = coord.x * 100
60 note.y = coord.y * 100 63 note.y = coord.y * 100
61 end 64 end
62 end 65 end
63 end 66 end
64 67
65 --[[ 68 --[[
66 Overwrites RECIPEPROFIT_alliance and RECIPEPROFIT_horde dbs. 69 Overwrites RECIPEPROFIT_alliance and RECIPEPROFIT_horde dbs.
67 ]] 70 ]]
68 for _, note in pairs(RECIPEPROFIT_alliance) do 71 for _, note in pairs(RECIPEPROFIT_alliance, RECIPEPROFIT_location_cache) do
69 fix_coords(note) 72 fix_coords(note)
70 end 73 end
71 74
72 for _, note in pairs(RECIPEPROFIT_horde) do 75 for _, note in pairs(RECIPEPROFIT_horde, RECIPEPROFIT_location_cache) do
73 fix_coords(note) 76 fix_coords(note)
74 end 77 end