Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects

This commit is contained in:
hondacrx
2018-01-27 20:15:24 -05:00
parent 854ae39aeb
commit 419ee1b882
19 changed files with 382 additions and 328 deletions
+4 -4
View File
@@ -3451,8 +3451,8 @@ namespace Game
// We use spawn coords to spawn
if (!map.Instanceable() && !map.IsRemovalGrid(x, y))
{
Creature creature = new Creature();
if (!creature.LoadCreatureFromDB(guid, map))
Creature creature = Creature.CreateCreatureFromDB(guid, map);
if (!creature)
{
Log.outError(LogFilter.Server, "AddCreature: Cannot add creature entry {0} to map", entry);
return 0;
@@ -4290,8 +4290,8 @@ namespace Game
// We use spawn coords to spawn
if (!map.Instanceable() && map.IsGridLoaded(x, y))
{
GameObject go = new GameObject();
if (!go.LoadGameObjectFromDB(guid, map))
GameObject go = GameObject.CreateGameObjectFromDB(guid, map);
if (!go)
{
Log.outError(LogFilter.Server, "AddGOData: cannot add gameobject entry {0} to map", entry);
return 0;