Misc fixes

This commit is contained in:
hondacrx
2024-03-19 17:21:32 -04:00
parent 5237c49b77
commit 1e421b9f53
71 changed files with 337 additions and 319 deletions
+6 -7
View File
@@ -3870,7 +3870,7 @@ namespace Game
public CreatureData NewOrExistCreatureData(ulong spawnId)
{
if (creatureDataStorage.ContainsKey(spawnId))
if (!creatureDataStorage.ContainsKey(spawnId))
creatureDataStorage[spawnId] = new CreatureData();
return creatureDataStorage[spawnId];
}
@@ -10429,12 +10429,11 @@ namespace Game
TaxiNodeFlags requireFlag = (team == Team.Alliance) ? TaxiNodeFlags.ShowOnAllianceMap : TaxiNodeFlags.ShowOnHordeMap;
foreach (var node in CliDB.TaxiNodesStorage.Values)
{
var i = node.Id;
if (node.ContinentID != mapid || !node.GetFlags().HasFlag(requireFlag) || node.GetFlags().HasFlag(TaxiNodeFlags.IgnoreForFindNearest))
if (node.ContinentID != mapid || !node.HasFlag(requireFlag) || node.HasFlag(TaxiNodeFlags.IgnoreForFindNearest))
continue;
uint field = (i - 1) / 8;
byte submask = (byte)(1 << (int)((i - 1) % 8));
uint field = (node.Id - 1) / 8;
byte submask = (byte)(1 << (int)((node.Id - 1) % 8));
// skip not taxi network nodes
if ((CliDB.TaxiNodesMask[field] & submask) == 0)
@@ -10446,14 +10445,14 @@ namespace Game
if (dist2 < dist)
{
dist = dist2;
id = i;
id = node.Id;
}
}
else
{
found = true;
dist = dist2;
id = i;
id = node.Id;
}
}