View Single Post
06-17-05, 10:51 AM   #3
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
you can also add chat message calls to relevant portions of code that you think might be causing a problem. Use it as debug code, and comment it out when you are done with it. As an example, I stuck in some basic chatframe outputs to your SathPanel_UpdateDPS function, and included it below. Try this and see if it helps:

Code:
function SathPanel_UpdateDPS()
	local TimeElapsed = (GetTime() - FightStartTime) + 1;
	ChatFrame1:AddMessage("SathPanel_UpdateDPS() Checkpoint: TimeElapsed = "..TimeElapsed, 1, 1, 1);	
	if (PlayerDPSConfig == 1) then
		if (PlayerDamage < 1) then		  -- Begone stupid divide by zero crashes
			PlayerDamage = 1;
		end
		local PlayerDPS = PlayerDamage / TimeElapsed;
	    ChatFrame1:AddMessage("SathPanel_UpdateDPS() Checkpoint: PlayerDPS = "..PlayerDPS, 1, 1, 1);   
		PlayerDPS = PlayerDPS + LastPlayerDamage;
	    ChatFrame1:AddMessage("SathPanel_UpdateDPS() Checkpoint: PlayerDPS = "..PlayerDPS, 1, 1, 1);   
		PlayerDPS = PlayerDPS / 2;
	    ChatFrame1:AddMessage("SathPanel_UpdateDPS() Checkpoint: PlayerDPS = "..PlayerDPS, 1, 1, 1);   
		SathPanel_PlayerDPS:SetText("DPS: "..math.floor(PlayerDPS+0.05));
		LastPlayerDamage = PlayerDPS;
	end
	if (TargetDPSConfig == 1) then
		if (EnemyDamage < 1) then
			EnemyDamage = 1;
		end
		local TargetDPS = EnemyDamage / TimeElapsed;
		TargetDPS = TargetDPS + LastEnemyDamage;
		TargetDPS = TargetDPS / 2;
		SathPanel_TargetDPS:SetText("DPS: "..math.floor(TargetDPS+0.05));
		LastEnemyDamage = TargetDPS;
	end
end
  Reply With Quote