changeset 68:3bed6d51e077

Make sure subgroup field is always set to non-nil. ("Belt *and* suspenders." Handle a previously-set nil field during text creation.)
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Wed, 09 May 2012 09:38:14 +0000
parents c01875b275ca
children 8442272a8418
files core.lua text_tabs.lua
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core.lua	Tue May 08 02:41:23 2012 +0000
+++ b/core.lua	Wed May 09 09:38:14 2012 +0000
@@ -9,7 +9,7 @@
 - raiders       accumulating raid roster data as we see raid members; indexed
                 by player name with subtable fields:
 -    class      capitalized English codename ("WARRIOR", "DEATHKNIGHT", etc)
--    subgroup   1-8
+-    subgroup   1-8 (NUM_RAID_GROUPS), NRG+1 if something's wrong
 -    race       English codename ("BloodElf", etc)
 -    sex        1 = unknown/error, 2 = male, 3 = female
 -    level      can be 0 if player was offline at the time
@@ -909,7 +909,7 @@
 					g_loot.raiders[name] = { needinfo=true }
 				end
 				local r = g_loot.raiders[name]
-				r.subgroup = subgroup
+				r.subgroup = subgroup or (NUM_RAID_GROUPS+1)
 				if r.needinfo and UnitIsVisible(unit) then
 					r.needinfo = nil
 					r.class    = class    --select(2,UnitClass(unit))
--- a/text_tabs.lua	Tue May 08 02:41:23 2012 +0000
+++ b/text_tabs.lua	Wed May 09 09:38:14 2012 +0000
@@ -148,7 +148,7 @@
 	-- Assumption:  everybody is packed into the first N groups.
 	if raidertable then for name,info in pairs(raidertable) do
 		if info.online ~= 3 then   -- 3 == left the raid
-			if info.subgroup <= max_group_number then
+			if (info.subgroup or (NUM_RAID_GROUPS+1)) <= max_group_number then
 				tins (ingroups, name)
 			else
 				tins (outgroups, name)