Fix OvaleEnemies to track the number of enemies correctly.
Fix OvaleEnemies to track the number of enemies correctly.
Before this change, the enemies table was not being updated properly when
UNIT_DIED was received.
Split out the routines to add and remove enemies into public methods to
make the code more DRY.
API change: Remove method GetNumberOfEnemies() and introduce a public
static variable ``activeEnemies'' that holds the number of active enemies.
Schedule a timer to remove enemies that haven't been active for at least 3
seconds. These are either not in combat with your group, out of range, or
incapacitated and shouldn't count toward your active enemies.
When a unit is no longer an active enemy, throw a new Ovale event
``Ovale_InactiveUnit'' that has the GUID of the dead unit as an event
parameter.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@780 d5049fe3-3747-40f7-a4b5-f36d6801af5f