Core/Commands: Fixed .gobject add command

(cherry picked from commit b4d044aa13b06ae50b4e468d6647bd7a9eb1cc3e)
This commit is contained in:
Shauren committed 2015-09-25 19:58:13 +02:00
1 parent 2c16edbdf3
commit 9207304d32
1 file changed
+2
@@ -166,6 +166,8 @@ public:
// fill the gameobject data and save to the db
object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn());
guidLow = object->GetSpawnId();
// delete the old object and do a clean load from DB with a fresh new GameObject instance.
// this is required to avoid weird behavior and memory leaks
delete object;