Core/SmartScript: Fixed possible crashes when attempting to use StoreTargetList with a the same list already stored on the same id

This commit is contained in:
Shauren
2012-03-19 11:43:50 +01:00
parent eff48a42d1
commit 90cacb9ab9

View File

@@ -98,7 +98,13 @@ class SmartScript
return;
if (mTargetStorage->find(id) != mTargetStorage->end())
{
// check if already stored
if ((*mTargetStorage)[id] == targets)
return;
delete (*mTargetStorage)[id];
}
(*mTargetStorage)[id] = targets;
}