mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Core/Misc): Change const to be after type name (#10591)
This commit is contained in:
@@ -3774,7 +3774,7 @@ void Map::DoForAllPlayers(std::function<void(Player*)> exec)
|
||||
* overloaded method with the start coords when you need to do a quick check on small segments
|
||||
*
|
||||
*/
|
||||
bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, PathGenerator *path, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
bool Map::CanReachPositionAndGetValidCoords(WorldObject const* source, PathGenerator *path, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
{
|
||||
G3D::Vector3 prevPath = path->GetStartPosition();
|
||||
for (auto & vector : path->GetPath())
|
||||
@@ -3814,19 +3814,19 @@ bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, PathGener
|
||||
*
|
||||
**/
|
||||
|
||||
bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float& destX, float& destY, float& destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
bool Map::CanReachPositionAndGetValidCoords(WorldObject const* source, float& destX, float& destY, float& destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
{
|
||||
return CanReachPositionAndGetValidCoords(source, source->GetPositionX(), source->GetPositionY(), source->GetPositionZ(), destX, destY, destZ, failOnCollision, failOnSlopes);
|
||||
}
|
||||
|
||||
bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
bool Map::CanReachPositionAndGetValidCoords(WorldObject const* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
{
|
||||
if (!CheckCollisionAndGetValidCoords(source, startX, startY, startZ, destX, destY, destZ, failOnCollision))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const Unit* unit = source->ToUnit();
|
||||
Unit const* unit = source->ToUnit();
|
||||
// if it's not an unit (Object) then we do not have to continue
|
||||
// with walkable checks
|
||||
if (!unit)
|
||||
@@ -3838,7 +3838,7 @@ bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float sta
|
||||
* Walkable checks
|
||||
*/
|
||||
bool isWaterNext = HasEnoughWater(unit, destX, destY, destZ);
|
||||
const Creature* creature = unit->ToCreature();
|
||||
Creature const* creature = unit->ToCreature();
|
||||
bool cannotEnterWater = isWaterNext && (creature && !creature->CanEnterWater());
|
||||
bool cannotWalkOrFly = !isWaterNext && !source->ToPlayer() && !unit->CanFly() && (creature && !creature->CanWalk());
|
||||
if (cannotEnterWater || cannotWalkOrFly ||
|
||||
@@ -3857,7 +3857,7 @@ bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float sta
|
||||
* @return true if the destination is valid, false otherwise
|
||||
*
|
||||
**/
|
||||
bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision) const
|
||||
bool Map::CheckCollisionAndGetValidCoords(WorldObject const* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision) const
|
||||
{
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Acore::IsValidMapCoord(startX, startY, startZ) || !Acore::IsValidMapCoord(destX, destY, destZ))
|
||||
@@ -3874,7 +3874,7 @@ bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float start
|
||||
path.SetUseRaycast(true);
|
||||
bool result = path.CalculatePath(startX, startY, startZ, destX, destY, destZ, false);
|
||||
|
||||
const Unit* unit = source->ToUnit();
|
||||
Unit const* unit = source->ToUnit();
|
||||
bool notOnGround = path.GetPathType() & PATHFIND_NOT_USING_PATH
|
||||
|| isWaterNext || (unit && unit->IsFlying());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user