mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[12684] Fix a VC90 compile problem. Also add some const correctness
author @Schmoozerd
This commit is contained in:
parent
ab23f6978a
commit
c6ae586f4a
4 changed files with 13 additions and 11 deletions
|
|
@ -53,7 +53,7 @@ class MANGOS_DLL_SPEC MovementGenerator
|
||||||
virtual void unitSpeedChanged() { }
|
virtual void unitSpeedChanged() { }
|
||||||
|
|
||||||
// used by Evade code for select point to evade with expected restart default movement
|
// used by Evade code for select point to evade with expected restart default movement
|
||||||
virtual bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
|
virtual bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/) const { return false; }
|
||||||
|
|
||||||
// given destination unreachable? due to pathfinsing or other
|
// given destination unreachable? due to pathfinsing or other
|
||||||
virtual bool IsReachable() const { return true; }
|
virtual bool IsReachable() const { return true; }
|
||||||
|
|
@ -92,10 +92,10 @@ class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
|
||||||
// u->AssertIsType<T>();
|
// u->AssertIsType<T>();
|
||||||
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
|
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
|
||||||
}
|
}
|
||||||
bool GetResetPosition(Unit& u, float& x, float& y, float& z) override
|
bool GetResetPosition(Unit& u, float& x, float& y, float& z) const override
|
||||||
{
|
{
|
||||||
// u->AssertIsType<T>();
|
// u->AssertIsType<T>();
|
||||||
return (static_cast<D*>(this))->GetResetPosition(*((T*)&u), x, y, z);
|
return (static_cast<D const*>(this))->GetResetPosition(*((T*)&u), x, y, z);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// Will not link if not overridden in the generators
|
// Will not link if not overridden in the generators
|
||||||
|
|
@ -106,7 +106,7 @@ class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
|
||||||
bool Update(T& u, const uint32& time_diff);
|
bool Update(T& u, const uint32& time_diff);
|
||||||
|
|
||||||
// not need always overwrites
|
// not need always overwrites
|
||||||
bool GetResetPosition(T& /*u*/, float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
|
bool GetResetPosition(T& /*u*/, float& /*x*/, float& /*y*/, float& /*z*/) const { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
|
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
|
||||||
|
|
|
||||||
|
|
@ -247,14 +247,16 @@ void WaypointMovementGenerator<Creature>::MovementInform(Creature& creature)
|
||||||
creature.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode);
|
creature.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x, float& y, float& z)
|
bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x, float& y, float& z) const
|
||||||
{
|
{
|
||||||
// prevent a crash at empty waypoint path.
|
// prevent a crash at empty waypoint path.
|
||||||
if (!i_path || i_path->empty())
|
if (!i_path || i_path->empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const WaypointNode& node = i_path->at(i_currentNode);
|
WaypointPath::const_iterator currPoint = i_path->find(i_currentNode);
|
||||||
x = node.x; y = node.y; z = node.z;
|
MANGOS_ASSERT(currPoint != i_path->end());
|
||||||
|
|
||||||
|
x = currPoint->second.x; y = currPoint->second.y; z = currPoint->second.z;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -399,7 +401,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z)
|
bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z) const
|
||||||
{
|
{
|
||||||
const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
|
const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
|
||||||
x = node.x; y = node.y; z = node.z;
|
x = node.x; y = node.y; z = node.z;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ class MANGOS_DLL_SPEC WaypointMovementGenerator<Creature>
|
||||||
// now path movement implmementation
|
// now path movement implmementation
|
||||||
void LoadPath(Creature& c);
|
void LoadPath(Creature& c);
|
||||||
|
|
||||||
bool GetResetPosition(Creature&, float& x, float& y, float& z);
|
bool GetResetPosition(Creature&, float& x, float& y, float& z) const;
|
||||||
|
|
||||||
void AddToWaypointPauseTime(int32 waitTimeDiff);
|
void AddToWaypointPauseTime(int32 waitTimeDiff);
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ class MANGOS_DLL_SPEC FlightPathMovementGenerator
|
||||||
void SetCurrentNodeAfterTeleport();
|
void SetCurrentNodeAfterTeleport();
|
||||||
void SkipCurrentNode() { ++i_currentNode; }
|
void SkipCurrentNode() { ++i_currentNode; }
|
||||||
void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure);
|
void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure);
|
||||||
bool GetResetPosition(Player&, float& x, float& y, float& z);
|
bool GetResetPosition(Player&, float& x, float& y, float& z) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12683"
|
#define REVISION_NR "12684"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue