Core/Spells: rework part 4: iterate over effects first

Ref #18395

Implement far spell queue processing
Closes #7395
This commit is contained in:
ariel-
2018-02-01 13:10:51 -03:00
committed by Ariel Silva
parent e8d5aa56cc
commit 080d2c6cd4
10 changed files with 619 additions and 635 deletions

View File

@@ -3395,8 +3395,22 @@ bool Map::IsSpawnGroupActive(uint32 groupId) const
return (_toggledSpawnGroupIds.find(groupId) != _toggledSpawnGroupIds.end()) != !(data->flags & SPAWNGROUP_FLAG_MANUAL_SPAWN);
}
void Map::AddFarSpellCallback(FarSpellCallback&& callback)
{
_farSpellCallbacks.Enqueue(new FarSpellCallback(std::move(callback)));
}
void Map::DelayedUpdate(uint32 t_diff)
{
{
FarSpellCallback* callback;
while (_farSpellCallbacks.Dequeue(callback))
{
(*callback)(this);
delete callback;
}
}
for (_transportsUpdateIter = _transports.begin(); _transportsUpdateIter != _transports.end();)
{
Transport* transport = *_transportsUpdateIter;