aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2024_11_22_02_world.sql24
-rw-r--r--src/common/Utilities/Duration.h5
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp1
-rw-r--r--src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.cpp22
-rw-r--r--src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.h1
5 files changed, 38 insertions, 15 deletions
diff --git a/sql/updates/world/master/2024_11_22_02_world.sql b/sql/updates/world/master/2024_11_22_02_world.sql
new file mode 100644
index 00000000000..c2aaa1522eb
--- /dev/null
+++ b/sql/updates/world/master/2024_11_22_02_world.sql
@@ -0,0 +1,24 @@
+SET @CGUID := 8000020;
+SET @OGUID := 8000020;
+
+-- Creature templates
+DELETE FROM `creature_template_addon` WHERE `entry` IN (165505);
+INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
+(165505, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, ''); -- 165505 (Loretta Banks)
+
+-- Difficulties
+UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=57689 WHERE (`Entry`=165505 AND `DifficultyID`=0); -- 165505 (Loretta Banks) - CanSwim
+DELETE FROM `creature_template_difficulty` WHERE `Entry` IN (165505) AND `DifficultyID`=1;
+
+-- Gossips
+UPDATE `creature_template_gossip` SET `VerifiedBuild`=57689 WHERE (`CreatureID`=165505 AND `MenuID`=25369) OR (`CreatureID`=167032 AND `MenuID`=25426) OR (`CreatureID`=89174 AND `MenuID`=14146);
+
+-- Creature spawns
+DELETE FROM `creature` WHERE `guid`=@CGUID+0;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `VerifiedBuild`) VALUES
+(@CGUID+0, 165505, 0, 1519, 1519, '0', 0, 0, 0, 0, -8450.576171875, 372.789947509765625, 135.7928619384765625, 5.341039180755615234, 120, 0, 0, 0, NULL, NULL, NULL, NULL, 57689); -- Loretta Banks (Area: Stormwind City - Difficulty: 0) CreateObject1
+
+-- Gameobject spawns
+DELETE FROM `gameobject` WHERE `guid`=@OGUID+0;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(@OGUID+0, 281118, 0, 1519, 1519, '0', 0, 0, -8450.7568359375, 376.12847900390625, 135.70953369140625, 6.11305093765258789, 0, 0, -0.08496475219726562, 0.996383965015411376, 120, 255, 1, 57689); -- Gryphon Roost (Area: Stormwind City - Difficulty: 0) CreateObject1
diff --git a/src/common/Utilities/Duration.h b/src/common/Utilities/Duration.h
index b4c3f17cb3e..f506467abda 100644
--- a/src/common/Utilities/Duration.h
+++ b/src/common/Utilities/Duration.h
@@ -18,12 +18,7 @@
#ifndef _DURATION_H_
#define _DURATION_H_
-// HACKS TERRITORY
-#if __has_include(<__msvc_chrono.hpp>)
-#include <__msvc_chrono.hpp> // skip all the formatting/istream/locale/mutex bloat
-#else
#include <chrono>
-#endif
/// Milliseconds shorthand typedef.
typedef std::chrono::milliseconds Milliseconds;
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index fd6952e22fd..c4087827424 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -35,6 +35,7 @@
#include <numeric>
#include <sstream>
#include <cctype>
+#include <cmath>
// temporary hack until includes are sorted out (don't want to pull in Windows.h)
#ifdef GetClassName
diff --git a/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.cpp b/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.cpp
index c68a657c066..85249caab78 100644
--- a/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.cpp
+++ b/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.cpp
@@ -25,12 +25,14 @@ void EntityFragmentsHolder::Add(EntityFragment fragment, bool update)
{
ASSERT(Count < Ids.size());
- auto insertSorted = [](auto& arr, uint8& count, EntityFragment f)
+ auto insertSorted = []<size_t N>(std::array<EntityFragment, N>& arr, uint8& count, EntityFragment f)
{
- auto where = std::ranges::lower_bound(arr.begin(), arr.begin() + count, f);
+ auto end = arr.begin() + count;
+ auto where = std::ranges::lower_bound(arr.begin(), end, f);
if (*where == f)
return std::pair(where, false);
- std::rotate(where, arr.begin() + count, arr.begin() + count + 1);
+
+ std::ranges::move_backward(where, end, end + 1);
++count;
*where = f;
return std::pair(where, true);
@@ -44,7 +46,7 @@ void EntityFragmentsHolder::Add(EntityFragment fragment, bool update)
ASSERT(UpdateableCount < UpdateableIds.size());
auto insertedItr = insertSorted(UpdateableIds, UpdateableCount, fragment).first;
- std::ptrdiff_t index = std::distance(UpdateableIds.begin(), insertedItr);
+ std::ptrdiff_t index = std::ranges::distance(UpdateableIds.begin(), insertedItr);
uint8 maskLowPart = ContentsChangedMask & ((1 << index) - 1);
uint8 maskHighPart = (ContentsChangedMask & ~((1 << index) - 1)) << (1 + IsIndirectFragment(fragment));
ContentsChangedMask = maskLowPart | maskHighPart;
@@ -65,13 +67,13 @@ void EntityFragmentsHolder::Add(EntityFragment fragment, bool update)
void EntityFragmentsHolder::Remove(EntityFragment fragment)
{
- auto removeSorted = [](auto& arr, uint8& count, EntityFragment f)
+ auto removeSorted = []<size_t N>(std::array<EntityFragment, N>& arr, uint8& count, EntityFragment f)
{
- auto where = std::ranges::find(arr.begin(), arr.begin() + count, f);
- if (where != arr.end())
+ auto end = arr.begin() + count;
+ auto where = std::ranges::find(arr.begin(), end, f);
+ if (where != end)
{
- *where = EntityFragment::End;
- std::rotate(where, where + 1, arr.begin() + count);
+ *std::ranges::move(where + 1, end, where).out = EntityFragment::End;
--count;
return std::pair(where, true);
}
@@ -86,7 +88,7 @@ void EntityFragmentsHolder::Remove(EntityFragment fragment)
auto [removedItr, removed] = removeSorted(UpdateableIds, UpdateableCount, fragment);
if (removed)
{
- std::ptrdiff_t index = std::distance(UpdateableIds.begin(), removedItr);
+ std::ptrdiff_t index = std::ranges::distance(UpdateableIds.begin(), removedItr);
uint8 maskLowPart = ContentsChangedMask & ((1 << index) - 1);
uint8 maskHighPart = (ContentsChangedMask & ~((1 << index) - 1)) >> (1 + IsIndirectFragment(fragment));
ContentsChangedMask = maskLowPart | maskHighPart;
diff --git a/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.h b/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.h
index 42d1ec52063..dba9e0a11a9 100644
--- a/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.h
+++ b/src/server/game/Entities/Object/Updates/WowCSEntityDefinitions.h
@@ -19,6 +19,7 @@
#define TRINITYCORE_WOWCS_ENTITY_DEFINITIONS_H
#include "Define.h"
+#include <array>
#include <span>
namespace WowCS