mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Taxi: Implemented PlayerCondition requirements on taxi paths
This commit is contained in:
@@ -2368,7 +2368,7 @@ inline bool PlayerConditionLogic(uint32 logic, std::array<bool, N>& results)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ConditionMgr::IsPlayerMeetingCondition(Player* player, PlayerConditionEntry const* condition)
|
||||
bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditionEntry const* condition)
|
||||
{
|
||||
if (condition->MinLevel && player->getLevel() < condition->MinLevel)
|
||||
return false;
|
||||
@@ -2489,7 +2489,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player* player, PlayerConditionEntry
|
||||
|
||||
if (condition->PartyStatus)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
Group const* group = player->GetGroup();
|
||||
switch (condition->PartyStatus)
|
||||
{
|
||||
case 1:
|
||||
|
||||
@@ -271,7 +271,7 @@ class TC_GAME_API ConditionMgr
|
||||
bool IsObjectMeetingSmartEventConditions(int64 entryOrGuid, uint32 eventId, uint32 sourceType, Unit* unit, WorldObject* baseObject) const;
|
||||
bool IsObjectMeetingVendorItemConditions(uint32 creatureId, uint32 itemId, Player* player, Creature* vendor) const;
|
||||
|
||||
static bool IsPlayerMeetingCondition(Player* player, PlayerConditionEntry const* condition);
|
||||
static bool IsPlayerMeetingCondition(Player const* player, PlayerConditionEntry const* condition);
|
||||
|
||||
struct ConditionTypeInfo
|
||||
{
|
||||
|
||||
@@ -185,8 +185,9 @@ uint32 TaxiPathGraph::EdgeCost::EvaluateDistance(Player const* player) const
|
||||
if (!(To->Flags & requireFlag))
|
||||
return std::numeric_limits<uint16>::max();
|
||||
|
||||
//if (To->ConditionID && !player->MeetsCondition(To->ConditionID))
|
||||
// return std::numeric_limits<uint16>::max();
|
||||
if (PlayerConditionEntry const* condition = sPlayerConditionStore.LookupEntry(To->ConditionID))
|
||||
if (!sConditionMgr->IsPlayerMeetingCondition(player, condition))
|
||||
return std::numeric_limits<uint16>::max();
|
||||
|
||||
return Distance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user