Core/Misc: Various crash fixes (#19059)

* Replaced some FindPlayer calls with GetPlayer
Fixed some more crashes

* Correction

(cherrypicked from 14dfc377b4)
This commit is contained in:
xinef1
2017-02-05 23:42:31 +01:00
committed by Shauren
parent ad4e63bae1
commit 4f65dc5e20
19 changed files with 61 additions and 34 deletions

View File

@@ -310,7 +310,7 @@ void Map::ScriptsProcess()
switch (step.sourceGUID.GetHigh())
{
case HighGuid::Item: // as well as HIGHGUID_CONTAINER
if (Player* player = HashMapHolder<Player>::Find(step.ownerGUID))
if (Player* player = GetPlayer(step.ownerGUID))
source = player->GetItemByGuid(step.sourceGUID);
break;
case HighGuid::Creature:
@@ -321,7 +321,7 @@ void Map::ScriptsProcess()
source = GetPet(step.sourceGUID);
break;
case HighGuid::Player:
source = HashMapHolder<Player>::Find(step.sourceGUID);
source = GetPlayer(step.sourceGUID);
break;
case HighGuid::GameObject:
case HighGuid::Transport:
@@ -350,7 +350,7 @@ void Map::ScriptsProcess()
target = GetPet(step.targetGUID);
break;
case HighGuid::Player:
target = HashMapHolder<Player>::Find(step.targetGUID);
target = GetPlayer(step.targetGUID);
break;
case HighGuid::GameObject:
case HighGuid::Transport: