View Single Post
05-15-13, 04:26 PM   #3
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Ok, my opinion is that it is not worth the time to update the existing addon.
Even if you fix the problem of COMBAT_LOG_EVENT_UNFILTERED (some extra event args were inserted at mop launch, and that is why the AddOn no longer works at all), there are so many things to consider that for me it would become unmanageable to update the AddOn for major future content patches(which is why probably nobody has bothered yet).

A lot of improvements can be made to reduce CPU stress, for example:
  1. Every localization string or configuration setting is initialized or saved as a global, while it is good practice to combine them into a dictionary or associative table and then store a local reference to this global table.
  2. The event handler, on the other hand, does make use of tables, but it does so in a way that a vararg table is created for every event (yes, for COMBAT_LOG_EVENT_UNFILTERED as well...):
    Code:
    --This function handles the used game events. 
    function BS_OnEvent(self, event, ...) 
    local args = {...}; 
    if (event == "ADDON_LOADED") then 
    if (args[1] == "BloodyScreen") then 
    BS_Init(); 
    end 
    end 
    
    if ((event == "UNIT_COMBO_POINTS") and (BS_BloodBehaviour == 1)) then 
    if (((BS_EnableOnPVP) and (UnitIsPlayer("target"))) or ((BS_EnableOnPVE) and (not UnitIsPlayer("target")))) then BS_AddSplatters(args); end 
    end 
    
    if ((event == "COMBAT_LOG_EVENT_UNFILTERED") and (BS_BloodBehaviour > 1)) then 
    if (((BS_EnableOnPVP) and (UnitIsPlayer("target"))) or ((BS_EnableOnPVE) and (not UnitIsPlayer("target")))) then BS_AddSplatters(args); end 
    end 
    end
  Reply With Quote