# HG changeset patch # User James D. Callahan III # Date 1340223246 18000 # Node ID 768c5f3587c241f87d2475f628fe3a523b8ef9db # Parent 786292c0bcc8bcb7d73d4de7585d76639727b5e9 Added optional location_label parameter to UpdateDBEntryLocation() to differentiate fishing locations, since the serializer is incapable of properly handling same-name fields with different values which are located in completely different tables. diff -r 786292c0bcc8 -r 768c5f3587c2 Main.lua --- a/Main.lua Wed Jun 20 12:29:02 2012 -0500 +++ b/Main.lua Wed Jun 20 15:14:06 2012 -0500 @@ -251,21 +251,22 @@ end -- do-block -local function UpdateDBEntryLocation(entry_type, identifier) +local function UpdateDBEntryLocation(entry_type, identifier, location_label) if not identifier then return end local zone_name, area_id, x, y, map_level, difficulty_token = CurrentLocationData() local entry = DBEntry(entry_type, identifier) + local location_field = location_label or "locations" entry[difficulty_token] = entry[difficulty_token] or {} - entry[difficulty_token].locations = entry[difficulty_token].locations or {} + entry[difficulty_token][location_field] = entry[difficulty_token][location_field] or {} local zone_token = ("%s:%d"):format(zone_name, area_id) - local zone_data = entry[difficulty_token].locations[zone_token] + local zone_data = entry[difficulty_token][location_field][zone_token] if not zone_data then zone_data = {} - entry[difficulty_token].locations[zone_token] = zone_data + entry[difficulty_token][location_field][zone_token] = zone_data end local location_token = ("%s:%s:%s"):format(map_level, x, y) zone_data[location_token] = zone_data[location_token] or true @@ -1223,7 +1224,7 @@ action_data.identifier = identifier elseif bit.band(spell_flags, AF.ZONE) == AF.ZONE then local identifier = ("%s:%s"):format(spell_label, _G["GameTooltipTextLeft1"]:GetText() or "NONE") -- Possible fishing pool name. - action_data.zone_data = UpdateDBEntryLocation("zones", identifier) + action_data.zone_data = UpdateDBEntryLocation("zones", identifier, "fishing_locations") action_data.type = AF.ZONE action_data.identifier = identifier end