mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 05:26:22 +00:00
Movement priority
This commit is contained in:
@@ -24,6 +24,7 @@ LastMovement::LastMovement(LastMovement& other)
|
||||
lastMoveShort = other.lastMoveShort;
|
||||
nextTeleport = other.nextTeleport;
|
||||
lastPath = other.lastPath;
|
||||
priority = other.priority;
|
||||
}
|
||||
|
||||
void LastMovement::clear()
|
||||
@@ -41,6 +42,7 @@ void LastMovement::clear()
|
||||
nextTeleport = 0;
|
||||
msTime = 0;
|
||||
lastdelayTime = 0;
|
||||
priority = MovementPriority::MOVEMENT_NORMAL;
|
||||
}
|
||||
|
||||
void LastMovement::Set(Unit* follow)
|
||||
@@ -51,7 +53,7 @@ void LastMovement::Set(Unit* follow)
|
||||
lastFollow = follow;
|
||||
}
|
||||
|
||||
void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori, float delayTime)
|
||||
void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori, float delayTime, MovementPriority pri)
|
||||
{
|
||||
lastMoveToMapId = mapId;
|
||||
lastMoveToX = x;
|
||||
@@ -62,6 +64,7 @@ void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori, float
|
||||
lastMoveShort = WorldPosition(mapId, x, y, z, ori);
|
||||
msTime = getMSTime();
|
||||
lastdelayTime = delayTime;
|
||||
priority = pri;
|
||||
}
|
||||
|
||||
void LastMovement::setShort(WorldPosition point)
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
// High priority movement can override the previous low priority one
|
||||
enum class MovementPriority
|
||||
{
|
||||
MOVEMENT_IDLE,
|
||||
MOVEMENT_NORMAL,
|
||||
MOVEMENT_COMBAT,
|
||||
MOVEMENT_FORCED
|
||||
};
|
||||
|
||||
class LastMovement
|
||||
{
|
||||
public:
|
||||
@@ -28,14 +37,14 @@ public:
|
||||
lastMoveShort = other.lastMoveShort;
|
||||
lastPath = other.lastPath;
|
||||
nextTeleport = other.nextTeleport;
|
||||
|
||||
priority = other.priority;
|
||||
return *this;
|
||||
};
|
||||
|
||||
void clear();
|
||||
|
||||
void Set(Unit* follow);
|
||||
void Set(uint32 mapId, float x, float y, float z, float ori, float delayTime);
|
||||
void Set(uint32 mapId, float x, float y, float z, float ori, float delayTime, MovementPriority priority = MovementPriority::MOVEMENT_NORMAL);
|
||||
|
||||
void setShort(WorldPosition point);
|
||||
void setPath(TravelPath path);
|
||||
@@ -53,6 +62,7 @@ public:
|
||||
float lastdelayTime;
|
||||
WorldPosition lastMoveShort;
|
||||
uint32 msTime;
|
||||
MovementPriority priority;
|
||||
TravelPath lastPath;
|
||||
time_t nextTeleport;
|
||||
std::future<TravelPath> future;
|
||||
|
||||
Reference in New Issue
Block a user