Core/Scripts: Fix possible crash

Fix possible NULL dereference crash spotted by Coverity.
This commit is contained in:
jackpoz
2014-08-06 20:55:43 +02:00
parent 2d8c965226
commit 0f07dcfea6

View File

@@ -824,10 +824,9 @@ void Map::ScriptsProcess()
}
Creature* cTarget = NULL;
if (source) //using grid searcher
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (wSource) //using grid searcher
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
CellCoord p(Trinity::ComputeCellCoord(wSource->GetPositionX(), wSource->GetPositionY()));
Cell cell(p);