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 -5
View File
@@ -707,9 +707,8 @@ namespace Game.Garrisons
return null;
}
Position pos = PacketInfo.PlotPos;
GameObject go = new GameObject();
if (!go.Create(entry, map, pos, Quaternion.WAxis, 255, GameObjectState.Active))
GameObject go = GameObject.CreateGameObject(entry, map, PacketInfo.PlotPos, Quaternion.WAxis, 255, GameObjectState.Ready);
if (!go)
return null;
if (BuildingInfo.CanActivate() && BuildingInfo.PacketInfo.HasValue && !BuildingInfo.PacketInfo.Value.Active)
@@ -718,8 +717,8 @@ namespace Game.Garrisons
if (finalizeInfo != null)
{
Position pos2 = finalizeInfo.factionInfo[faction].Pos;
GameObject finalizer = new GameObject();
if (finalizer.Create(finalizeInfo.factionInfo[faction].GameObjectId, map, pos2, Quaternion.WAxis, 255, GameObjectState.Ready))
GameObject finalizer = GameObject.CreateGameObject(finalizeInfo.factionInfo[faction].GameObjectId, map, pos2, Quaternion.WAxis, 255, GameObjectState.Ready);
if (finalizer)
{
// set some spell id to make the object delete itself after use
finalizer.SetSpellId(finalizer.GetGoInfo().Goober.spell);