diff options
author | MitchesD <majklprofik@seznam.cz> | 2015-12-03 21:37:33 +0100 |
---|---|---|
committer | MitchesD <majklprofik@seznam.cz> | 2015-12-03 21:41:03 +0100 |
commit | ab831507c64c8a0bc838ec835299c79f88c70ed7 (patch) | |
tree | c1110beb024c02fae5d24338d31bd1bbe4318785 | |
parent | 94e4bddb903d581293b5a7f50f9b32d1262d2c20 (diff) |
Core/Conditions: extended CONDITION_NEAR_CREATURE, condition value 3 is now used to check for dead creature entries (0 - alive, 1 - dead)
* I used 0 for alive to avoid touching all conditions with this type
(cherry picked from commit cdb5bd3eb78ea40fbd927c5662e1dad778bf12d5)
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 8e8c640ccf7..bae400adcc2 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -89,7 +89,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND { "PhaseMask", true, false, false }, { "Level", true, true, false }, { "Quest Completed", true, false, false }, - { "Near Creature", true, true, false }, + { "Near Creature", true, true, true }, { "Near GameObject", true, true, false }, { "Object Entry or Guid", true, true, true }, { "Object TypeMask", true, false, false }, @@ -280,7 +280,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const } case CONDITION_NEAR_CREATURE: { - condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2) ? true : false; + condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) ? true : false; break; } case CONDITION_NEAR_GAMEOBJECT: diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 81fe379f0db..43454aba049 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -59,7 +59,7 @@ enum ConditionTypes CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement) CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded - CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range + CONDITION_NEAR_CREATURE = 29, // creature entry distance dead (0/1) true if there is a creature of entry in range CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance 0 true if there is a gameobject of entry in range CONDITION_OBJECT_ENTRY_GUID = 31, // TypeID entry guid true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object CONDITION_TYPE_MASK = 32, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask |