mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
[7690] Move GetCreature/GetGameobject to class Map. Author: VladimirMangos
* This let get objects at map without reference to player or another object.
* Simplify future implementation for per-map storage for like objects
--HG--
branch : trunk
This commit is contained in:
@@ -552,7 +552,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObject* target = ObjectAccessor::GetGameObject(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
|
||||
GameObject* target = m_session->GetPlayer()->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
|
||||
|
||||
PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name, lowguid, id, x, y, z, mapid, o);
|
||||
|
||||
@@ -1384,7 +1384,7 @@ bool ChatHandler::HandleNpcDeleteCommand(const char* args)
|
||||
return false;
|
||||
|
||||
if (CreatureData const* cr_data = objmgr.GetCreatureData(lowguid))
|
||||
unit = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
|
||||
unit = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
|
||||
}
|
||||
else
|
||||
unit = getSelectedCreature();
|
||||
@@ -3071,7 +3071,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
|
||||
// Did the user select a visual spawnpoint?
|
||||
if(wpGuid)
|
||||
wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
wpCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
// attempt check creature existence by DB data
|
||||
else
|
||||
{
|
||||
@@ -3141,7 +3141,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
|
||||
if( wpGuid != 0 )
|
||||
{
|
||||
wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
wpCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
wpCreature->CombatStop();
|
||||
wpCreature->DeleteFromDB();
|
||||
wpCreature->AddObjectToRemoveList();
|
||||
@@ -3170,7 +3170,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
// Respawn the owner of the waypoints
|
||||
if( wpGuid != 0 )
|
||||
{
|
||||
wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
wpCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
wpCreature->CombatStop();
|
||||
wpCreature->DeleteFromDB();
|
||||
wpCreature->AddObjectToRemoveList();
|
||||
@@ -3281,11 +3281,8 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
pathid = atoi((char*)guid_str);
|
||||
}
|
||||
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpShowCommand: danach");
|
||||
|
||||
|
||||
|
||||
std::string show = show_str;
|
||||
uint32 Maxpoint;
|
||||
|
||||
@@ -3364,7 +3361,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
{
|
||||
Field *fields = result2->Fetch();
|
||||
uint32 wpguid = fields[0].GetUInt32();
|
||||
Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpguid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
|
||||
Creature* pCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpguid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
|
||||
|
||||
if(!pCreature)
|
||||
{
|
||||
@@ -3582,7 +3579,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
|
||||
Creature* pCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
|
||||
|
||||
if(!pCreature)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user