Rochet2 / TrinityCore

Rochet2's stuff for TC
https://rochet2.github.io
90 stars 143 forks source link

[GOMove] GetObjectGlobalyWithGuidOrNearWithDbGuid() is replaced #51

Closed Magnifikator closed 7 years ago

Magnifikator commented 7 years ago

GetObjectGlobalyWithGuidOrNearWithDbGuid() is replaced by GetObjectFromPlayerMapByDbGuid()

So you can replace 2x in GOMove.cpp as follows:

GameObject* GOMove::GetGameObject(Player* player, ObjectGuid::LowType lowguid)
{
//    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
//        return ChatHandler(player->GetSession()).GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, data->id);

//    return nullptr;
    return ChatHandler(player->GetSession()).GetObjectFromPlayerMapByDbGuid(lowguid);
}

(IMHO, this function is in this way not necessary anymore.)

and later:

//    GameObject* object = nullptr;
//    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
//        object = ChatHandler(player->GetSession()).GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, data->id);
    GameObject* object = ChatHandler(player->GetSession()).GetObjectFromPlayerMapByDbGuid(lowguid);
Rochet2 commented 7 years ago

These changes were already applied, no? https://github.com/Rochet2/TrinityCore/commit/f9b511b01b3f4874ef24d822ad129f2258a7753e "Rochet2 committed on Jan 23"

Magnifikator commented 7 years ago

Strange, seems that I missed a commit. Sorry than. And thanks for the good work. I like this modification very much.

Btw: What's the difference between Floor and Ground ? Looks as if it has the same effect.

Rochet2 commented 7 years ago

Btw: What's the difference between Floor and Ground ? Looks as if it has the same effect.

Floor is actually what we want. Floor is the first hit downwards from the current gps. Ground is the actual ground level. This may be noticeable in for example in orgrimmar most likely.

Try standing in orgrimmar, do .gps and see the ground and floor coordinates be different. "Ground" refers to the ground that is below the stormwind's ground and the floor refers to the "real ground" that players see and walk on.