fix(Core/Misc): Change const to be after type name (#10591)

This commit is contained in:
Kitzunu
2022-02-14 20:05:45 +01:00
committed by GitHub
parent 9b83abca39
commit 455899dc75
168 changed files with 438 additions and 438 deletions

View File

@@ -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());