From 758aae32e08b9b24bf613466ada8f1a1ab8ff02b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 16 Jan 2019 19:43:07 -0500 Subject: [PATCH] Misc. fixes --- .../Database/Databases/LoginDatabase.cs | 4 ++-- Source/Game/Chat/Commands/AccountCommands.cs | 4 ++-- Source/Game/DataStorage/DB2Manager.cs | 17 +++++++++------- Source/Game/DungeonFinding/LFGManager.cs | 2 +- Source/Game/Entities/Unit/Unit.Movement.cs | 2 +- .../world/master/2019_01_14_00_world.sql | 3 +++ .../world/master/2019_01_15_00_world.sql | 20 +++++++++++++++++++ 7 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/master/2019_01_14_00_world.sql create mode 100644 sql/updates/world/master/2019_01_15_00_world.sql diff --git a/Source/Framework/Database/Databases/LoginDatabase.cs b/Source/Framework/Database/Databases/LoginDatabase.cs index ad6787930..998485f45 100644 --- a/Source/Framework/Database/Databases/LoginDatabase.cs +++ b/Source/Framework/Database/Databases/LoginDatabase.cs @@ -62,7 +62,7 @@ namespace Framework.Database PrepareStatement(LoginStatements.INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL"); PrepareStatement(LoginStatements.UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?"); PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?"); - PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY, "UPDATE account SET lock_country = ? WHERE id = ?"); + PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY, "UPDATE account SET lock_country = ? WHERE id = ?"); PrepareStatement(LoginStatements.INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)"); PrepareStatement(LoginStatements.UPD_USERNAME, "UPDATE account SET username = ?, sha_pass_hash = ? WHERE id = ?"); PrepareStatement(LoginStatements.UPD_PASSWORD, "UPDATE account SET sha_pass_hash = ? WHERE id = ?"); @@ -212,7 +212,7 @@ namespace Framework.Database INS_REALM_CHARACTERS_INIT, UPD_EXPANSION, UPD_ACCOUNT_LOCK, - UPD_ACCOUNT_LOCK_CONTRY, + UPD_ACCOUNT_LOCK_COUNTRY, INS_LOG, UPD_USERNAME, UPD_PASSWORD, diff --git a/Source/Game/Chat/Commands/AccountCommands.cs b/Source/Game/Chat/Commands/AccountCommands.cs index a6ebde01c..9713be3cb 100644 --- a/Source/Game/Chat/Commands/AccountCommands.cs +++ b/Source/Game/Chat/Commands/AccountCommands.cs @@ -757,7 +757,7 @@ namespace Game.Chat if (!result.IsEmpty()) { string country = result.Read(0); - stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY); + stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY); stmt.AddValue(0, country); stmt.AddValue(1, handler.GetSession().GetAccountId()); DB.Login.Execute(stmt); @@ -771,7 +771,7 @@ namespace Game.Chat } else if (param == "off") { - PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY); + PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY); stmt.AddValue(0, "00"); stmt.AddValue(1, handler.GetSession().GetAccountId()); DB.Login.Execute(stmt); diff --git a/Source/Game/DataStorage/DB2Manager.cs b/Source/Game/DataStorage/DB2Manager.cs index ad3a7daec..962d16fce 100644 --- a/Source/Game/DataStorage/DB2Manager.cs +++ b/Source/Game/DataStorage/DB2Manager.cs @@ -1754,14 +1754,17 @@ namespace Game.DataStorage areaEntry = CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID); } - MapRecord mapEntry = CliDB.MapStorage.LookupByKey(mapId); - if (mapEntry != null) + if (mapId > 0) { - iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], (int)mapEntry.Id); - if (mapEntry.ParentMapID >= 0) - iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.ParentMapID); - if (mapEntry.CosmeticParentMapID >= 0) - iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.CosmeticParentMapID); + MapRecord mapEntry = CliDB.MapStorage.LookupByKey(mapId); + if (mapEntry != null) + { + iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], (int)mapEntry.Id); + if (mapEntry.ParentMapID >= 0) + iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.ParentMapID); + if (mapEntry.CosmeticParentMapID >= 0) + iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.CosmeticParentMapID); + } } return nearestMapAssignment.UiMapAssignment; diff --git a/Source/Game/DungeonFinding/LFGManager.cs b/Source/Game/DungeonFinding/LFGManager.cs index 764db206e..7c6f7936f 100644 --- a/Source/Game/DungeonFinding/LFGManager.cs +++ b/Source/Game/DungeonFinding/LFGManager.cs @@ -1504,7 +1504,7 @@ namespace Game.DungeonFinding else if (dungeon.expansion > (uint)expansion) lockStatus = LfgLockStatusType.InsufficientExpansion; else if (Global.DisableMgr.IsDisabledFor(DisableType.Map, dungeon.map, player)) - lockStatus = LfgLockStatusType.RaidLocked; + lockStatus = LfgLockStatusType.NotInSeason; else if (Global.DisableMgr.IsDisabledFor(DisableType.LFGMap, dungeon.map, player)) lockStatus = LfgLockStatusType.RaidLocked; else if (dungeon.difficulty > Difficulty.Normal && player.GetBoundInstance(dungeon.map, dungeon.difficulty) != null) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index 647838b2f..da550b30d 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -544,7 +544,7 @@ namespace Game.Entities } // Check if angular distance changed - bool turn = MathFunctions.fuzzyGt(Math.PI - Math.Abs(Math.Abs(GetOrientation() - orientation) - Math.PI), 0.0f); + bool turn = MathFunctions.fuzzyGt((float)Math.PI - Math.Abs(Math.Abs(GetOrientation() - orientation) - (float)Math.PI), 0.0f); // G3D::fuzzyEq won't help here, in some cases magnitudes differ by a little more than G3D::eps, but should be considered equal bool relocated = (teleport || Math.Abs(GetPositionX() - x) > 0.001f || diff --git a/sql/updates/world/master/2019_01_14_00_world.sql b/sql/updates/world/master/2019_01_14_00_world.sql new file mode 100644 index 000000000..9c0e51b9c --- /dev/null +++ b/sql/updates/world/master/2019_01_14_00_world.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `creature` WHERE `id` IN (36506) AND `guid`=85216; +DELETE FROM `creature_addon` WHERE `guid`=85216; diff --git a/sql/updates/world/master/2019_01_15_00_world.sql b/sql/updates/world/master/2019_01_15_00_world.sql new file mode 100644 index 000000000..75f9fa818 --- /dev/null +++ b/sql/updates/world/master/2019_01_15_00_world.sql @@ -0,0 +1,20 @@ +-- +DELETE FROM `creature` WHERE `guid` IN (252354,252359,252364,252369,252373,252378,252392,252400,252402,252404,252406,252407,252408,252409,252420,252423,252424); +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `phaseUseFlags`, `PhaseId`, `PhaseGroup`, `terrainSwapMap`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`) VALUES +(252354, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12118.2, -1795.6, 80.2195, 0.356404, 300, 0, 0, 116235, 0), +(252359, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12114, -1794.06, 80.3472, 3.40966, 300, 0, 0, 116235, 0), +(252364, 52348, 859, 0, 0, "2", 169, 0, 0, -1, 0, 0, -12237.3, -1818.77, 129.414, 6.18603, 300, 0, 0, 1202925, 0), +(252369, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12255.6, -1835.91, 131.565, 4.74561, 300, 0, 0, 116235, 0), +(252373, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12274.2, -1838.78, 131.407, 4.938, 300, 0, 0, 116235, 0), +(252378, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12300.7, -1806.29, 130.962, 3.08838, 300, 0, 0, 116235, 0), +(252392, 52956, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12296.5, -1824.48, 130.262, 4.06699, 300, 0, 0, 641560, 0), +(252400, 52088, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12297.8, -1832.84, 130.285, 2.14512, 300, 0, 0, 387450, 44540), +(252402, 52606, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12304.5, -1827.04, 130.277, 6.01634, 300, 0, 0, 641560, 0), +(252404, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12288.1, -1872.98, 131.44, 0.377164, 300, 0, 0, 116235, 0), +(252406, 52606, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12333.1, -1857.21, 130.3, 0.833478, 300, 0, 0, 641560, 0), +(252407, 52606, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12260, -1849.02, 131.455, 1.34792, 300, 0, 0, 641560, 0), +(252408, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12118.5, -1778.3, 80.1776, 1.51967, 300, 0, 0, 116235, 0), +(252409, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12113, -1782, 80.5676, 1.51967, 300, 0, 0, 116235, 0), +(252420, 52089, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12124.6, -1781.83, 80.4969, 1.28405, 300, 0, 0, 116235, 0), +(252423, 52079, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12296.1, -1897.87, 130.282, 2.0919, 300, 0, 0, 619920, 0), +(252424, 52079, 859, 0, 0, "2", 169, 0, 0, -1, 0, 1, -12290.8, -1893.57, 130.339, 2.11089, 300, 0, 0, 619920, 0);