Fixed crashes and errors when loading into world.
This commit is contained in:
@@ -3559,7 +3559,7 @@ namespace Game.Entities
|
||||
uint _stateChangeProgress;
|
||||
List<uint> _stopFrames = new();
|
||||
bool _autoCycleBetweenStopFrames;
|
||||
TimeTracker _positionUpdateTimer;
|
||||
TimeTracker _positionUpdateTimer = new();
|
||||
List<WorldObject> _passengers = new();
|
||||
|
||||
static TimeSpan PositionUpdateInterval = TimeSpan.FromMilliseconds(50);
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace Game.Entities
|
||||
|
||||
public void ClearChangesMask<U>(OptionalUpdateField<U> updateField) where U : new()
|
||||
{
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)))
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)) && updateField.HasValue())
|
||||
((IHasChangesMask)updateField._value).ClearChangesMask();
|
||||
}
|
||||
|
||||
|
||||
@@ -2981,9 +2981,9 @@ namespace Game.Entities
|
||||
public bool IsPermanentWorldObject() { return m_isWorldObject; }
|
||||
|
||||
public ITransport GetTransport() { return m_transport; }
|
||||
public T GetTransport<T>() where T : ITransport
|
||||
public T GetTransport<T>() where T : class, ITransport
|
||||
{
|
||||
return (T)m_transport;
|
||||
return m_transport as T;
|
||||
}
|
||||
public float GetTransOffsetX() { return m_movementInfo.transport.pos.GetPositionX(); }
|
||||
public float GetTransOffsetY() { return m_movementInfo.transport.pos.GetPositionY(); }
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace Game.Entities
|
||||
|
||||
public void InitTaxiNodesForLevel(Race race, Class chrClass, uint level)
|
||||
{
|
||||
m_taximask = new byte[((CliDB.TaxiNodesStorage.GetNumRows() - 1) / 8) + 1];
|
||||
|
||||
// class specific initial known nodes
|
||||
if (chrClass == Class.Deathknight)
|
||||
{
|
||||
@@ -105,6 +107,8 @@ namespace Game.Entities
|
||||
|
||||
public void LoadTaxiMask(string data)
|
||||
{
|
||||
m_taximask = new byte[((CliDB.TaxiNodesStorage.GetNumRows() - 1) / 8) + 1];
|
||||
|
||||
var split = new StringArray(data, ' ');
|
||||
|
||||
int index = 0;
|
||||
|
||||
Reference in New Issue
Block a user