Quantcast

In ExpandTrainerData(), ExpandVendorData(), ExpandMobData(), and ExpandQuestData(): Fixed problem where an empty line would appear in the list if the coordinates were an empty string and hide_location was true.

James D. Callahan III [03-26-10 - 07:41]
In ExpandTrainerData(), ExpandVendorData(), ExpandMobData(), and ExpandQuestData(): Fixed problem where an empty line would appear in the list if the coordinates were an empty string and hide_location was true.
Filename
Frame.lua
diff --git a/Frame.lua b/Frame.lua
index 52f66d5..c298acb 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -2973,12 +2973,14 @@ do

 		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)

+		if coord_text == "" and hide_location then
+			return entry_index
+		end
 		t = AcquireTable()
 		t.text = string.format("%s%s%s %s", PADDING, PADDING, hide_location and "" or trainer.location, coord_text)
 		t.recipe_id = recipe_id

-		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
-		return entry_index
+		return MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
 	end

 	-- Right now PVP obtained items are located on vendors so they have the vendor and PVP flag.
@@ -3004,12 +3006,14 @@ do

 		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)

+		if coord_text == "" and hide_location then
+			return entry_index
+		end
 		t = AcquireTable()
 		t.text = string.format("%s%s%s %s", PADDING, PADDING, hide_location and "" or vendor.location, coord_text)
 		t.recipe_id = recipe_id

-		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
-		return entry_index
+		return MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
 	end

 	-- Mobs can be in instances, raids, or specific mob related drops.
@@ -3029,12 +3033,14 @@ do

 		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)

+		if coord_text == "" and hide_location then
+			return entry_index
+		end
 		t = AcquireTable()
 		t.text = string.format("%s%s%s %s", PADDING, PADDING, hide_location and "" or mob.location, coord_text)
 		t.recipe_id = recipe_id

-		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
-		return entry_index
+		return MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
 	end

 	local function ExpandQuestData(entry_index, entry_type, id_num, recipe_id, hide_location, hide_type)
@@ -3057,12 +3063,14 @@ do

 		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)

+		if coord_text == "" and hide_location then
+			return entry_index
+		end
 		t = AcquireTable()
 		t.text = string.format("%s%s%s %s", PADDING, PADDING, hide_location and "" or quest.location, coord_text)
 		t.recipe_id = recipe_id

-		entry_index = MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
-		return entry_index
+		return MainPanel.scroll_frame:InsertEntry(t, parent_entry, entry_index, entry_type, true)
 	end

 	local function ExpandSeasonalData(entry_index, entry_type, id_num, recipe_id, hide_location, hide_type)