aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index a0cd1e7daab..6d377e5f874 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -107,11 +107,11 @@ public:
}
template <class Predicate>
- void DoAction(int32 info, Predicate& predicate, uint16 max = 0)
+ void DoAction(int32 info, Predicate&& predicate, uint16 max = 0)
{
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
StorageType listCopy = storage_;
- Trinity::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
+ Trinity::Containers::RandomResizeList<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max);
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); )
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
@@ -133,7 +133,7 @@ class TC_GAME_API EntryCheckPredicate
{
public:
EntryCheckPredicate(uint32 entry) : _entry(entry) { }
- bool operator()(ObjectGuid guid) { return guid.GetEntry() == _entry; }
+ bool operator()(ObjectGuid const& guid) const { return guid.GetEntry() == _entry; }
private:
uint32 _entry;
@@ -142,7 +142,7 @@ class TC_GAME_API EntryCheckPredicate
class TC_GAME_API DummyEntryCheckPredicate
{
public:
- bool operator()(ObjectGuid) { return true; }
+ bool operator()(ObjectGuid const&) const { return true; }
};
struct TC_GAME_API ScriptedAI : public CreatureAI