mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/ConditionMgr: small cleanup, small fix
--HG-- branch : trunk
This commit is contained in:
@@ -281,7 +281,7 @@ bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList condit
|
||||
ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry)
|
||||
{
|
||||
ConditionList spellCond;
|
||||
if (sType > CONDITION_SOURCE_TYPE_NONE && sType < MAX_CONDITIONSOURCETYPE)
|
||||
if (sType > CONDITION_SOURCE_TYPE_NONE && sType < CONDITION_SOURCE_TYPE_MAX)
|
||||
{
|
||||
ConditionMap::const_iterator itr = m_ConditionMap.find(sType);
|
||||
if (itr != m_ConditionMap.end())
|
||||
@@ -568,7 +568,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
|
||||
|
||||
bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
{
|
||||
if (cond->mSourceType == CONDITION_SOURCE_TYPE_NONE || cond->mSourceType >= MAX_CONDITIONSOURCETYPE)
|
||||
if (cond->mSourceType == CONDITION_SOURCE_TYPE_NONE || cond->mSourceType >= CONDITION_SOURCE_TYPE_MAX)
|
||||
{
|
||||
sLog.outErrorDb("Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->mSourceType));
|
||||
return false;
|
||||
@@ -935,7 +935,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
}
|
||||
bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (cond->mConditionType == CONDITION_NONE || cond->mConditionType >= MAX_CONDITION)
|
||||
if (cond->mConditionType == CONDITION_NONE || cond->mConditionType >= CONDITION_MAX)
|
||||
{
|
||||
sLog.outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType),cond->mSourceEntry);
|
||||
return false;
|
||||
|
||||
@@ -54,11 +54,10 @@ enum ConditionType
|
||||
CONDITION_MAPID = 22, // map_id 0 +referenceID true if in map_id
|
||||
CONDITION_AREAID = 23, // area_id 0 +referenceID true if in area_id
|
||||
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
|
||||
CONDITION_SPELL = 25 // spell_id 0 +referenceID true if knows spell
|
||||
CONDITION_SPELL = 25, // spell_id 0 +referenceID true if knows spell
|
||||
CONDITION_MAX = 26 // MAX
|
||||
};
|
||||
|
||||
#define MAX_CONDITION 25 // maximum value in ConditionType enum
|
||||
|
||||
enum ConditionSourceType
|
||||
{
|
||||
CONDITION_SOURCE_TYPE_NONE = 0,//DONE
|
||||
@@ -81,11 +80,10 @@ enum ConditionSourceType
|
||||
CONDITION_SOURCE_TYPE_SPELL = 17,//DONE
|
||||
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,//DONE
|
||||
CONDITION_SOURCE_TYPE_MAX = 21//MAX
|
||||
};
|
||||
|
||||
#define MAX_CONDITIONSOURCETYPE 21
|
||||
|
||||
struct Condition
|
||||
{
|
||||
ConditionSourceType mSourceType; //SourceTypeOrReferenceId
|
||||
|
||||
Reference in New Issue
Block a user