Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects
This commit is contained in:
@@ -473,10 +473,8 @@ namespace Game.Chat
|
||||
Player player = handler.GetPlayer();
|
||||
Map map = player.GetMap();
|
||||
|
||||
GameObject obj = new GameObject();
|
||||
|
||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(player.GetOrientation(), 0.0f, 0.0f));
|
||||
if (!obj.Create(objectInfo.entry, map, player, rotation, 255, GameObjectState.Ready))
|
||||
GameObject obj = GameObject.CreateGameObject(objectInfo.entry, map, player, new Quaternion(Matrix3.fromEulerAnglesZYX(player.GetOrientation(), 0.0f, 0.0f)), 255, GameObjectState.Ready);
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
obj.CopyPhaseFrom(player);
|
||||
@@ -491,7 +489,8 @@ namespace Game.Chat
|
||||
ulong spawnId = obj.GetSpawnId();
|
||||
|
||||
// this will generate a new guid if the object is in an instance
|
||||
if (!obj.LoadGameObjectFromDB(spawnId, map))
|
||||
obj = GameObject.CreateGameObjectFromDB(spawnId, map);
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
// TODO: is it really necessary to add both the real and DB table guid here ?
|
||||
|
||||
Reference in New Issue
Block a user