Core/MMaps: Use an enum for the poly flags

This commit is contained in:
Sebastian Valle
2013-10-05 14:28:53 -05:00
parent a84ed0af67
commit 6b149d18cd
2 changed files with 9 additions and 3 deletions

View File

@@ -139,13 +139,13 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo
void PathGenerator::CreateFilter()
{
uint16 includeFlags = 1 | 2;
uint16 includeFlags = POLY_FLAG_WALK | POLY_FLAG_SWIM;
uint16 excludeFlags = 0;
if (_sourceUnit->GetTypeId() == TYPEID_UNIT && !_sourceUnit->ToCreature()->CanSwim())
{
includeFlags = 1;
excludeFlags = 2;
includeFlags = POLY_FLAG_WALK;
excludeFlags = POLY_FLAG_SWIM;
}
_filter.setIncludeFlags(includeFlags);

View File

@@ -37,6 +37,12 @@ enum PathType
PATHFIND_SHORT = 0x20, // path is longer or equal to its limited path length
};
enum PolyFlag
{
POLY_FLAG_WALK = 1,
POLY_FLAG_SWIM = 2
};
class PathGenerator
{
public: