public override void Convert(byte[] rawData) { var worldMapOverlayEntry = new WorldMapOverlayEntry(); worldMapOverlayEntry.WorldMapOverlayId = (WorldMapOverlayId)GetUInt32(rawData, 0); for (var i = 0; i < worldMapOverlayEntry.ZoneTemplateId.Length; i++) { var zoneId = (ZoneId)GetUInt32(rawData, 2 + i); if (zoneId == 0) { // We reached to the last ZoneId reference. break; } worldMapOverlayEntry.ZoneTemplateId[i] = zoneId; var zoneTemplate = World.s_ZoneTemplates[(int)zoneId]; if (zoneTemplate == null) { LogManager.GetCurrentClassLogger().Warn(string.Format( "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.", zoneId, worldMapOverlayEntry.WorldMapOverlayId)); continue; } zoneTemplate.WorldMapOverlays.Add(worldMapOverlayEntry.WorldMapOverlayId); } ArrayUtil.Set(ref World.s_WorldMapOverlayEntries, (uint)worldMapOverlayEntry.WorldMapOverlayId, worldMapOverlayEntry); }
public override void Convert(byte[] rawData) { WorldMapOverlayEntry val = new WorldMapOverlayEntry(); val.WorldMapOverlayId = (WorldMapOverlayId)DBCRecordConverter.GetUInt32(rawData, 0); for (int index = 0; index < val.ZoneTemplateId.Length; ++index) { ZoneId uint32 = (ZoneId)DBCRecordConverter.GetUInt32(rawData, 2 + index); if (uint32 != ZoneId.None) { val.ZoneTemplateId[index] = uint32; ZoneTemplate zoneTemplate = WCell.RealmServer.Global.World.s_ZoneTemplates[(int)uint32]; if (zoneTemplate == null) { LogManager.GetCurrentClassLogger().Warn(string.Format( "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.", (object)uint32, (object)val.WorldMapOverlayId)); } else { zoneTemplate.WorldMapOverlays.Add(val.WorldMapOverlayId); } } else { break; } } ArrayUtil.Set <WorldMapOverlayEntry>(ref WCell.RealmServer.Global.World.s_WorldMapOverlayEntries, (uint)val.WorldMapOverlayId, val); }
public override void Convert(byte[] rawData) { var worldMapOverlayEntry = new WorldMapOverlayEntry(); worldMapOverlayEntry.WorldMapOverlayId = (WorldMapOverlayId)GetUInt32(rawData, 0); for (var i = 0; i < worldMapOverlayEntry.ZoneTemplateId.Length; i++) { var zoneId = (ZoneId)GetUInt32(rawData, 2 + i); if (zoneId == 0) // We reached to the last ZoneId reference. break; worldMapOverlayEntry.ZoneTemplateId[i] = zoneId; var zoneTemplate = World.s_ZoneTemplates[(int)zoneId]; if (zoneTemplate == null) { LogManager.GetCurrentClassLogger().Warn(string.Format( "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.", zoneId, worldMapOverlayEntry.WorldMapOverlayId)); continue; } zoneTemplate.WorldMapOverlays.Add(worldMapOverlayEntry.WorldMapOverlayId); } ArrayUtil.Set(ref World.s_WorldMapOverlayEntries, (uint)worldMapOverlayEntry.WorldMapOverlayId, worldMapOverlayEntry); }