Fixes loading, *Command system is broke* Will fix in the coming days.

This commit is contained in:
hondacrx
2022-06-02 17:00:58 -04:00
parent 0af9f22d70
commit 11e8c2f4f2
26 changed files with 268 additions and 137 deletions
@@ -222,7 +222,7 @@ namespace Game.DataStorage
}
// 0 1 2 3 4 5 6 7
SQLResult circularMovementInfos = DB.World.Query("SELECT AreaTriggerCreatePropertiesId, StartDelay, CircleRadius, BlendFromRadius, InitialAngle, ZOffset, CounterClockwise, CanLoop FROM `areatrigger_create_properties_orbit` ORDER BY `SpellMiscId`");
SQLResult circularMovementInfos = DB.World.Query("SELECT AreaTriggerCreatePropertiesId, StartDelay, CircleRadius, BlendFromRadius, InitialAngle, ZOffset, CounterClockwise, CanLoop FROM `areatrigger_create_properties_orbit`");
if (!circularMovementInfos.IsEmpty())
{
do
+3 -3
View File
@@ -354,13 +354,13 @@ namespace Game.DataStorage
TaxiPathSetBySource[entry.FromTaxiNode][entry.ToTaxiNode] = new TaxiPathBySourceAndDestination(entry.Id, entry.Cost);
}
uint pathCount = TaxiPathStorage.Keys.Max() + 1;
uint pathCount = TaxiPathStorage.GetNumRows();
// Calculate path nodes count
uint[] pathLength = new uint[pathCount]; // 0 and some other indexes not used
foreach (TaxiPathNodeRecord entry in TaxiPathNodeStorage.Values)
if (pathLength[entry.PathID] < entry.NodeIndex + 1)
pathLength[entry.PathID] = entry.NodeIndex + 1u;
pathLength[entry.PathID] = (uint)entry.NodeIndex + 1u;
// Set path length
for (uint i = 0; i < pathCount; ++i)
@@ -370,7 +370,7 @@ namespace Game.DataStorage
foreach (var entry in TaxiPathNodeStorage.Values)
TaxiPathNodesByPath[entry.PathID][entry.NodeIndex] = entry;
var taxiMaskSize = ((TaxiNodesStorage.Count - 1) / 8) + 1;
var taxiMaskSize = TaxiNodesStorage.GetNumRows() + 1;
TaxiNodesMask = new byte[taxiMaskSize];
OldContinentsNodesMask = new byte[taxiMaskSize];
HordeTaxiNodesMask = new byte[taxiMaskSize];
@@ -22,6 +22,7 @@ using Framework.IO;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Reflection;
@@ -389,6 +390,8 @@ namespace Game.DataStorage
public uint GetTableHash() { return _header.TableHash; }
public uint GetNumRows() { return Keys.Max() + 1; }
public string GetName()
{
return _tableName;
@@ -219,7 +219,7 @@ namespace Game.DataStorage
if (Header.HasIndexTable() && indexData.Length != sparseIndexData.Length)
throw new Exception("indexData.Length != sparseIndexData.Length");
//indexData = sparseIndexData;
indexData = sparseIndexData;
}
BitReader bitReader = new(recordsData);
@@ -328,7 +328,7 @@ namespace Game.DataStorage
else
return columnMeta.Common.DefaultValue.As<T>();
case DB2ColumnCompression.Pallet:
case DB2ColumnCompression.PalletArray: //need for SummonProperties.db2
case DB2ColumnCompression.PalletArray:
uint palletIndex = _data.Read<uint>(columnMeta.Pallet.BitWidth);
return _palletData[fieldIndex][palletIndex].As<T>();
}
@@ -363,12 +363,12 @@ namespace Game.DataStorage
return arr2;
case DB2ColumnCompression.SignedImmediate:
T[] arr4 = new T[arraySize];
T[] arr3 = new T[arraySize];
for (int i = 0; i < arr4.Length; i++)
arr4[i] = _data.ReadSigned<T>(columnMeta.Immediate.BitWidth);
for (int i = 0; i < arr3.Length; i++)
arr3[i] = _data.ReadSigned<T>(columnMeta.Immediate.BitWidth);
return arr4;
return arr3;
case DB2ColumnCompression.PalletArray:
int cardinality = columnMeta.Pallet.Cardinality;
@@ -377,12 +377,12 @@ namespace Game.DataStorage
uint palletArrayIndex = _data.Read<uint>(columnMeta.Pallet.BitWidth);
T[] arr3 = new T[cardinality];
T[] arr4 = new T[cardinality];
for (int i = 0; i < arr3.Length; i++)
arr3[i] = _palletData[fieldIndex][i + cardinality * (int)palletArrayIndex].As<T>();
for (int i = 0; i < arr4.Length; i++)
arr4[i] = _palletData[fieldIndex][i + cardinality * (int)palletArrayIndex].As<T>();
return arr3;
return arr4;
}
throw new Exception(string.Format("Unexpected compression type {0}", columnMeta.CompressionType));
}
+2 -2
View File
@@ -853,7 +853,7 @@ namespace Game.DataStorage
public uint GetEmptyAnimStateID()
{
return (uint)AnimationDataStorage.Count;
return AnimationDataStorage.GetNumRows();
}
public List<uint> GetAreasForGroup(uint areaGroupId)
@@ -943,7 +943,7 @@ namespace Game.DataStorage
return levels[tier];
}
return (uint)AzeriteLevelInfoStorage.Count;
return AzeriteLevelInfoStorage.GetNumRows();
}
public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, Locale locale = Locale.enUS, Gender gender = Gender.Male, bool forceGender = false)
+1 -1
View File
@@ -281,7 +281,7 @@ namespace Game.DataStorage
public uint Id;
public short EffectAura;
public uint DifficultyID;
public uint EffectIndex;
public int EffectIndex;
public uint Effect;
public float EffectAmplitude;
public SpellEffectAttributes EffectAttributes;
+1 -1
View File
@@ -72,7 +72,7 @@ namespace Game.DataStorage
public Vector3 Loc;
public uint Id;
public ushort PathID;
public uint NodeIndex;
public int NodeIndex;
public ushort ContinentID;
public TaxiPathNodeFlags Flags;
public uint Delay;