diff db_fix.lua @ 47:c6a4525f7ba7 v2.01a release

(none)
author "Aaron Bregger <killermonkey99@gmail.com>"
date Tue, 04 Jan 2011 19:35:12 -0600
parents
children bc43986f7fb0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/db_fix.lua	Tue Jan 04 19:35:12 2011 -0600
@@ -0,0 +1,68 @@
+--[[--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))
+
+    RecipeProfit by -[@project-author@]-
+    
+    Rev:     @project-revision@
+    Updated: @file-date-iso@
+    
+--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))
+    
+    URL:
+        http://www.wrathguides.com/
+    
+	License:
+        This file is a part of "RecipeProfit for GatherMate."
+        
+		This program is free software; you can redistribute it and/or
+		modify it under the terms of the GNU General Public License
+		as published by the Free Software Foundation, either version 3
+		of the License, or (at your option) any later version.
+
+		This program is distributed in the hope that it will be useful,
+		but WITHOUT ANY WARRANTY; without even the implied warranty of
+		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+		GNU General Public License for more details.
+
+        You should have received a copy of the GNU General Public License
+        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+
+	Note:
+		This program's source code is specifically designed to work with
+		World of Warcraft's interpreted AddOn system.
+        
+		You have an implicit license to use this program with these facilities
+		since that is it's designated purpose as per:
+		http://www.fsf.org/licensing/licenses/gpl-faq.html#InterpreterIncompat
+    
+--]]--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))--))
+
+
+RECIPEPROFIT_location_cache = {
+
+}
+
+--[[
+    Replaces the X and Y coordinates in the coordinate cached database.
+]--]
+local function fix_coords(note, cdb)
+    for name, coord in pairs(cdb) do
+        if(note.vendor == name) then
+            note.x = coord.x * 100
+            note.y = coord.y * 100
+        end
+    end
+end
+
+--[--[
+    Overwrites RECIPEPROFIT_alliance and RECIPEPROFIT_horde dbs.
+]--]
+do
+    for _, note in pairs(RECIPEPROFIT_alliance) do
+        fix_coords(note, RECIPEPROFIT_location_cache)
+    end
+
+    for _, note in pairs(RECIPEPROFIT_horde) do
+        fix_coords(note, RECIPEPROFIT_location_cache)
+    end
+end
+]]