aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-11 15:03:34 -0500
committermegamage <none@none>2009-04-11 15:03:34 -0500
commitd697fbd158657cf6b708b186b73d277d46924a1d (patch)
treea7fa029f1e0e3fe9dd5628eea0f54df42ce6a7b0 /src/game/Unit.h
parentccd9f4eeb249378ed4e966e54d6f08f0c5288cce (diff)
parent9378a9cf211021c7a285026307f3a5f03af430dd (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.h')
-rw-r--r--src/game/Unit.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 33b03c821db..af902dba15a 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1495,6 +1495,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ }
static Unit* GetUnit(WorldObject& object, uint64 guid);
+ static Player* GetPlayer(uint64 guid);
+ static Creature* GetCreature(WorldObject& object, uint64 guid);
MotionMaster* GetMotionMaster() { return &i_motionMaster; }
@@ -1647,5 +1649,20 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 m_reducedThreatPercent;
uint64 m_misdirectionTargetGUID;
};
+
+namespace Trinity
+{
+ template<class T>
+ void RandomResizeList(std::list<T> &_list, uint32 _size)
+ {
+ while(_list.size() > _size)
+ {
+ typename std::list<T>::iterator itr = _list.begin();
+ advance(itr, urand(0, _list.size() - 1));
+ _list.erase(itr);
+ }
+ }
+}
+
#endif