mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user