Core/Commands: Fixed .gobject add command

(cherry picked from commit b4d044aa13)
This commit is contained in:
Shauren
2015-05-16 12:12:47 +02:00
parent 2c16edbdf3
commit 9207304d32

View File

@@ -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;