public void FinalizeDataHolder() { var trigger = AreaTriggerMgr.AreaTriggers.Get(Id); if (trigger == null) { ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.", Name, Id, Type); return; } else { trigger.Template = this; } if (TargetPos.IsSet) { var map = World.GetMapTemplate(TargetMap); if (map != null) { Type = AreaTriggerType.Teleport; ArrayUtil.AddOnlyOne(ref map.EntrancePositions, TargetPos); } } Handler = AreaTriggerMgr.GetHandler(Type); }
public void FinalizeDataHolder() { AreaTrigger areaTrigger = AreaTriggerMgr.AreaTriggers.Get <AreaTrigger>(this.Id); if (areaTrigger == null) { ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.", (object)this.Name, (object)this.Id, (object)this.Type); } else { areaTrigger.Template = this; if (this.TargetPos.IsSet) { MapTemplate mapTemplate = WCell.RealmServer.Global.World.GetMapTemplate(this.TargetMap); if (mapTemplate != null) { this.Type = AreaTriggerType.Teleport; int num = (int)ArrayUtil.AddOnlyOne <Vector3>(ref mapTemplate.EntrancePositions, this.TargetPos); } } this.Handler = AreaTriggerMgr.GetHandler(this.Type); } }