Core/Conditions: Add new CONDITION_TAXI (46). Does what it says on the tin. Tagging issue #15560.

This commit is contained in:
Aokromes
2016-08-20 14:48:34 +02:00
parent 8fcb5ace9d
commit 7ea03a2e47
2 changed files with 14 additions and 2 deletions

View File

@@ -107,7 +107,8 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
{ "Sit/stand state", true, true, false },
{ "Daily Quest Completed",true, false, false },
{ "Charmed", false, false, false },
{ "Pet type", true, false, false }
{ "Pet type", true, false, false },
{ "On Taxi", false, false, false }
};
// Checks if object meets the condition
@@ -476,6 +477,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
condMeets = (((1 << pet->getPetType()) & ConditionValue1) != 0);
break;
}
case CONDITION_TAXI:
{
if (Player* player = object->ToPlayer())
condMeets = player->IsInFlight();
break;
}
default:
condMeets = false;
break;
@@ -666,6 +673,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
case CONDITION_PET_TYPE:
mask |= GRID_MAP_TYPE_MASK_PLAYER;
break;
case CONDITION_TAXI:
mask |= GRID_MAP_TYPE_MASK_PLAYER;
break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -2275,6 +2285,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
break;
case CONDITION_IN_WATER:
case CONDITION_CHARMED:
case CONDITION_TAXI:
default:
break;
}

View File

@@ -76,7 +76,8 @@ enum ConditionTypes
CONDITION_DAILY_QUEST_DONE = 43, // quest id 0 0 true if daily quest has been completed for the day
CONDITION_CHARMED = 44, // 0 0 0 true if unit is currently charmed
CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s)
CONDITION_MAX = 46 // MAX
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
CONDITION_MAX = 47 // MAX
};
/*! Documentation on implementing a new ConditionSourceType: