mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 07:37:02 +00:00
[10338] Create Map version for GetPlayer/GetUnit fucntions
* This let make map local way access for cases when player/all units expected to be at same map (for scripts cases for example). Ofc, still exist many places where code expect world wide player search. Spell casting for support far target cases, groups/guilds/chat/etc packets * Function Unit::GetUnit depricated and will removed soon. * Function GetCreatureOrPetOrVehicle renamed to less horriable GetAnyTypeCreature name.
This commit is contained in:
parent
0aa9e5a133
commit
45cdc67f58
16 changed files with 22391 additions and 22313 deletions
|
|
@ -103,11 +103,12 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
|
|||
static Creature* GetCreatureInWorld(ObjectGuid guid) { return FindHelper<Creature>(guid); }
|
||||
static GameObject* GetGameObjectInWorld(ObjectGuid guid) { return FindHelper<GameObject>(guid); }
|
||||
|
||||
// possible local search for specific object map
|
||||
static Unit* GetUnit(WorldObject const &, ObjectGuid guid);
|
||||
// Search player at any map in world and other objects at same map with `obj`
|
||||
// Note: recommended use Map::GetUnit version if player also expected at same map only
|
||||
static Unit* GetUnit(WorldObject const& obj, ObjectGuid guid);
|
||||
|
||||
// Player access
|
||||
static Player* FindPlayer(ObjectGuid guid);
|
||||
static Player* FindPlayer(ObjectGuid guid); // if need player at specific map better use Map::GetPlayer
|
||||
static Player* FindPlayerByName(const char *name);
|
||||
static void KickPlayer(uint64 guid);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue