Core/Misc: Various crash fixes (#19059)

* Replaced some FindPlayer calls with GetPlayer
Fixed some more crashes

* Correction
This commit is contained in:
xinef1
2017-02-05 23:42:31 +01:00
committed by Shauren
parent 075f0e26cc
commit 14dfc377b4
22 changed files with 79 additions and 60 deletions

View File

@@ -295,7 +295,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::Unit:
@@ -306,7 +306,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::Transport:
case HighGuid::GameObject:
@@ -338,7 +338,7 @@ void Map::ScriptsProcess()
target = GetPet(step.targetGUID);
break;
case HighGuid::Player: // empty GUID case also
target = HashMapHolder<Player>::Find(step.targetGUID);
target = GetPlayer(step.targetGUID);
break;
case HighGuid::Transport:
case HighGuid::GameObject: