Core/Conditions: Prevent unneccessary copying condition list on every check
This commit is contained in:
@@ -252,7 +252,7 @@ ConditionList ConditionMgr::GetConditionReferences(uint32 refId)
|
|||||||
return conditions;
|
return conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker)
|
bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker /*= NULL*/)
|
||||||
{
|
{
|
||||||
std::map<uint32, bool> ElseGroupMap;
|
std::map<uint32, bool> ElseGroupMap;
|
||||||
for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
|
for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
|
||||||
@@ -295,7 +295,7 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, const ConditionLi
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList conditions, Unit* invoker)
|
bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker /*= NULL*/)
|
||||||
{
|
{
|
||||||
if (conditions.empty())
|
if (conditions.empty())
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class ConditionMgr
|
|||||||
bool isConditionTypeValid(Condition* cond);
|
bool isConditionTypeValid(Condition* cond);
|
||||||
ConditionList GetConditionReferences(uint32 refId);
|
ConditionList GetConditionReferences(uint32 refId);
|
||||||
|
|
||||||
bool IsPlayerMeetToConditions(Player* player, ConditionList conditions, Unit* invoker = NULL);
|
bool IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
|
||||||
ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry);
|
ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry);
|
||||||
ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID);
|
ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID);
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class ConditionMgr
|
|||||||
bool addToLootTemplate(Condition* cond, LootTemplate* loot);
|
bool addToLootTemplate(Condition* cond, LootTemplate* loot);
|
||||||
bool addToGossipMenus(Condition* cond);
|
bool addToGossipMenus(Condition* cond);
|
||||||
bool addToGossipMenuItems(Condition* cond);
|
bool addToGossipMenuItems(Condition* cond);
|
||||||
bool IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker = NULL);
|
bool IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
|
||||||
|
|
||||||
bool isGroupable(ConditionSourceType sourceType) const
|
bool isGroupable(ConditionSourceType sourceType) const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user