Skip to content

Commit

Permalink
Allow random 0 entries for SaveExistingSpawns
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jan 2, 2024
1 parent a7037b6 commit bbe498e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WowPacketParser/SQL/Builders/Spawns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ public static string GameObject(Dictionary<WowGuid, GameObject> gameObjects)
{
var spawnsDb = SQLDatabase.GetGameObjects(new RowList<GameObjectDB>());
var precision = 0.02f; // warning - some zones shifted by 0.2 in some cases between later expansions
// TODO: Add loading of randomized entry ID from pools (TC) and random/spawn_group (TBC)
foreach (var go in gobList)
{
var staticRot = go.GetStaticRotation();
var existingGo = spawnsDb.Where(p => p.Data.ID == (uint)go.ObjectData.EntryID
var existingGo = spawnsDb.Where(p => (p.Data.ID == 0 || p.Data.ID == (uint)go.ObjectData.EntryID) // 0 is used when spawn has randomized entry in cMaNGOS
&& p.Data.Map == go.Map
&& FloatComparison((float)p.Data.PosX, go.Movement.Position.X, precision)
&& FloatComparison((float)p.Data.PosY, go.Movement.Position.Y, precision)
Expand Down

0 comments on commit bbe498e

Please sign in to comment.