Commit Graph
100 Commits
Author SHA1 Message Date
Peter Keresztes Schmidt ec44c8296d Scripts/Commands: Use enum type arg for HandleDebugAnimCommand (PR #25256)
* Core/Shared: Make Emote enum smart
* Scripts/Commands: Use enum type arg for HandleDebugAnimCommand

(cherry picked from commit 86dc58974a46b554042f33df674e3e40ef0cec1e)
2022-01-26 22:16:05 +01:00
Peter Keresztes Schmidt 3923650aeb Core/ChatCommands: Add support for enum type arguments (PR #25242)
(cherry picked from commit 5e40eb20e2789b86d4786d86b4bbb8ae83de5e1e)
2022-01-26 22:13:06 +01:00
Peter Keresztes Schmidt 2e3c612c80 Core/Unit: Make HandleEmoteCommand typesafe (#25249)
* Scripts/ScarletMonastery: Fix wrong emote during Headless Horseman encounter

* Scripts/HoR: Fix wrong emote during escape event

* Core/Unit: Make improve type safety of HandleEmoteCommand

Change argument type to the expected enum type Emote

* Scripts/CoS: Use SetUInt32Value to set UNIT_NPC_EMOTESTATE

UNIT_NPC_EMOTESTATE is no flag field

(cherry picked from commit 6c7837f947ff4eb5110a116a371daa6f9e2b3bbe)
2022-01-26 21:46:51 +01:00
Peter Keresztes Schmidt 595e89e02b Core/Spells: Mark constructors of Spell/AuraScript handlers as explicit (#25248)
Mostly to make clang-tidy happier

(cherry picked from commit 34d403e83f42304332f89ffc73549f6f2c695ccd)
2022-01-26 20:57:27 +01:00
Carbenium d6c998a1a8 Core/Updater: Fix detection of the mysql binary when a directory is given as path
This ensures that we never pass a directory path StartProcess which results in a crash.

Closes #25216

(cherry picked from commit 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb)
2022-01-26 18:41:14 +01:00
Carbenium c302ace100 Scripts/AzjolNerub: Fix potential error in pound spell script
Cast damage spell in AfterEffectApply instead OnEffectHitTarget. This avoids the scenario where we try to apply an aura to a potential dead target.

Ref #21856

(cherry picked from commit 0dd4b685df53d9b61a53aaf3a577c2a9ed8cdd47)
2022-01-26 14:37:05 +01:00
Peter Keresztes Schmidt 43591bb4d5 Scripts/AzjolNerub: Update Anub'Arak encounter to current coding standards (#25192)
* Scripts/AzjolNerub: Update Anub'Arak to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Darter to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Assassin to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Guardian to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Venomancer to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Impale Target to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak Pound spell to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak carrion beetles aura script to current coding standards

(cherry picked from commit dab8768c183dc43f970187a65961fc8fce647c29)
2022-01-24 22:32:11 +01:00
Peter Keresztes Schmidt 5b1ba7b503 Scripts/Gundrak: Update Slad'ran encounter to current coding standards (#25180)
* Scripts/Gundrak: Update Slad'Ran's script to use TaskScheduler

* No functional changes

* Scripts/Gundrak: Update Slad'Ran's adds to use TaskScheduler

* No functional changes

(cherry picked from commit 7abe9d66d049204240060f1976c51ff2297bf266)
2022-01-24 21:58:00 +01:00
Peter Keresztes Schmidt 35a348dfdb Scripts/Gundrak: Update Drakkari Colossus encounter to current coding standards (#25182)
* Scripts/Gundrak: Update Drakkari Colossus to current coding standards

* no functional changes

* Scripts/Gundrak: Update Drakkari Elemental to current coding standards

* no functional changes

* Scripts/Gundrak: Update Living Mojo to current coding standards

* no functional changes

(cherry picked from commit dd8666f38d6aad6401e8e303c57c62255856f5a4)
2022-01-24 21:55:10 +01:00
Peter Keresztes Schmidt 0c65abe7a0 Scripts/MoltenCore: Update Golemagg encounter to current coding standards (#25183)
* Scripts/MoltenCore: Update Golemagg to current coding standards

* no functional changes

* Scripts/MoltenCore: Update Core Ranger to current coding standards

* no functional changes

(cherry picked from commit c88234727b47c037557eba6db8ae8ef1dee4eed7)
2022-01-24 21:54:10 +01:00
Carbenium 7e0fb710ad Scripts/AhnKahet: Update Herald Volazj to current coding standards
* convert to BossAI
* no functional changes

(cherry picked from commit 90543fd41db309d924a3d45939bd23cffb9f5b67)
2022-01-24 21:53:52 +01:00
Carbenium 18e5e1ef43 Scripts/AV: Update Vanndar's script to use TaskScheduler
* No functional changes

(cherry picked from commit 799d5376d8d7e2c9c0fc1e27cfadf2669a8724d0)
2022-01-24 21:35:52 +01:00
Carbenium 8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80bcd55d35445cd24ae119020c310f88)
2022-01-24 21:34:36 +01:00
Carbenium 35e0002df3 Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall

(cherry picked from commit e55516348dbabaa8c9d559426315f3f70967acaa)
2022-01-24 21:25:47 +01:00
Carbenium b3f2ff97ff Core/CreatureAI: std::chrono-ify DoSummon* methods
(cherry picked from commit 1245833cdd9988a2ac9c3a9374b40e76a53d889a)
2022-01-24 13:11:13 +01:00
Carbenium 82fce41852 Core/WorldObject: Replace non-std::chrono SummonGameObject overloads
Also fix intended despawn time of GOs used by the "Engineering a Disaster" quest

(cherry picked from commit 8642aaaf9268364454b409db7eb62f31210e6d6c)
2022-01-24 12:55:43 +01:00
Carbenium 217c2d9ef3 Core/WorldObject: Replace non-std::chrono SummonTrigger overloads
(cherry picked from commit 3620b47c412d88cc2e0ab10e2654913e5487c8ac)
2022-01-24 12:47:56 +01:00
Carbenium 3bba8d50b1 Core/WorldObject: Remove non-std::chrono SummonCreature overload
Remove
TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0);

(cherry picked from commit a41f599be72ccc88b13c1cf725f20cee4a5335d7)
2022-01-24 12:39:59 +01:00
Carbenium 03e4c0d7bf Core/Creature: Remove non-std::chrono overload of DespawnOrUnsummon
(cherry picked from commit 480dee3125929181b7004810516ea673c61f5811)
2022-01-24 12:21:26 +01:00
Carbenium a7cbb16229 Core/EventProcessor: std::chrono-ify the remaining public API
(cherry picked from commit 1d8782e3566393f71fbc091de57c96a9a15972cb)
2022-01-24 12:06:56 +01:00
Carbenium eeffb310de Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)

(cherry picked from commit 92a02a5c8750913f596d7e3b58bf8439cb770c28)
2022-01-24 12:00:35 +01:00
Carbenium 310f996b1d Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);

(cherry picked from commit 1131229ee9c43704b11187f0b11c327db92018b6)
2022-01-24 11:55:32 +01:00
Carbenium 906a47b161 tests/EventMap: Add tests for Repeat
(cherry picked from commit e6f36f83b8af4d973a96f01c6095b075dd12f5d5)
2022-01-24 00:01:48 +01:00
Carbenium da17942af9 Core/EventMap: Clarify documentation of ScheduleEvent
(cherry picked from commit 7865c1c197f4eb9165ef3ab26eb4f750a5b58960)
2022-01-24 00:01:38 +01:00
Carbenium a5d85deced Core/EventMap: Unify semantics of DelayEvents
DelayEvents(Milliseconds delay) had different semantics than
DelayEvents(Milliseconds delay, uint32 group).
The first method delayed the events only in the case the internal timer
already ticked at least for the amount of delay. In contrast the latter method
delayed events regardless of the internal timer value.

Use the latter semantics for DelayEvents(Milliseconds delay) as well which makes
the outcome more predictable. Adapt tests accordingly.

(cherry picked from commit 4470b9122379dc846b322a441951a03913912b71)
2022-01-24 00:01:25 +01:00
Carbenium 5512eb2f8f tests/EventMap: Test for event past it's execution time
With the switch to std::chrono return type of GetTimeUntilEvent
we don't run into an overflow condition which happend with the previous
uint32 return value if the events scheduled execution time is in the past.
Test for this case.

(cherry picked from commit e877f988d1c4e1361612f3d5c4ebe915f746aee5)
2022-01-24 00:00:47 +01:00
Carbenium 27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f1462387033e6bd2f99d0ea829fdcd8)
2022-01-23 23:59:46 +01:00
Carbenium 7847589d9c EventMap: Switch internal timer over to std::chrono type
Adds the EventMap::Update(Milliseconds time) overload

(cherry picked from commit b9795e44824c7cab58445e4a72d2113ddb451caa)
2022-01-23 23:59:32 +01:00
Carbenium a28bc7faaa Scripts/Kalimdor: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 40efda9726dce4fc6f432852f8d41bee606872b7)
2022-01-23 23:59:11 +01:00
Carbenium 38695b0943 Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428b124876ba48eacaf47806fd10a3c47)
2022-01-23 23:58:48 +01:00
Carbenium 271462ceec Scripts/Northrend: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit fc9e7226c0785fd12b01b724ed3666e6c08dd017)
2022-01-23 23:57:56 +01:00
Carbenium b8a3ab880f Core/Misc: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit c39eb9b5041950ce3af89f82848bd3e1f3a6e0af)
2022-01-23 23:56:25 +01:00
Carbenium 58e1c091a2 Scripts/EasternKingdoms: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit d1a39a2ebf3bb55998696c424cd58f3fcdedd66a)
2022-01-23 23:53:20 +01:00
Carbenium 5f5d32888a Core/EscortAI: std::chrono-ify SetPauseTimer
(cherry picked from commit cdaf890af4b5bb7ce256752b49bba2c0f3ed9264)
2022-01-23 23:34:52 +01:00
Carbenium 14e9513cea Core/EscortAI: std::chrono-ify AddWaypoint
(cherry picked from commit 4b9fdc5d3d1278269aaf218cea94f23688e4bca1)
2022-01-23 23:34:40 +01:00
Carbenium e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb25bff877a450a14fe20172e9044081)
2022-01-23 23:33:04 +01:00
Carbenium da438c73e2 Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead

(cherry picked from commit 27229c10cd6813e69ea6db69384312b1854b2b57)
2022-01-23 23:28:47 +01:00
Carbenium 5f296fb7c7 Core/InstanceScript: std::chrono-ify DoRespawnGameObject
(cherry picked from commit d7ff8c272ad016296e1eed5aae325e4e5058ddd8)
2022-01-23 23:09:27 +01:00
Carbenium 7c43afa471 Core/Utilities: Add custom _days chrono literal
(cherry picked from commit d5de96e46bf52ccb2fffe01c0709f9238977a80e)
2022-01-23 23:08:21 +01:00
Carbenium b336ed8996 Build: Add WITH_LD_GOLD option to use gold linker on unix
gold is an ELF-only linker which has a better performance
than the default ld.

(cherry picked from commit 796e2b32e03e7b1a56e44bd4b8988f9156bbb026)
2022-01-23 23:07:56 +01:00
Peter Keresztes Schmidt 10f835b058 Common/Crypto: #ifdef out unnecessary locking code for OpenSSL 1.1+ (PR #25110)
(cherry picked from commit 7ea33120a03d70aaa856c2c66f183d684131746e)
2022-01-23 23:07:33 +01:00
Carbenium ddeae5e7d2 tests: Add some basic tests for EventMap
(cherry picked from commit 7950275697c9d48781ad61cf3749e0392ee660bc)
2022-01-23 22:48:58 +01:00
Carbenium f837f28171 dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time.

Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target.

CircleCI: Run unit tests
(cherry picked from commit 6a28ee7b2a4269aa7e43265d1cd0067537e3e883)
2022-01-23 22:48:35 +01:00
Peter Keresztes Schmidt 3499f518b5 EventMap: Remove GetNextEventTime and GetTimer methods (PR #25092)
(cherry picked from commit 6ab9922171cf6e2877c39f503bcf987dd9faa898)
2022-01-23 22:20:20 +01:00
Carbenium 330e7100cb Core/Scripts: Fix timing issue of EVENT_FLY_TO_RANDOM_PILLAR during Illidan encounter
The intention here is to add additional 30 seconds of delay to the current delay of EVENT_FLY_TO_RANDOM_PILLAR.
Instead of EventMap::GetNextEventTime, EventMap::GetTimeUntilEvent has to be used which returns the currently
scheduled delay until the event occurs.
EventMap::GetNextEventTime instead exposes the timer value internal to EventMap at which the event should occur.

(cherry picked from commit f1f251eb381bccc9164e29a81da9e013090543a4)
2022-01-23 22:19:24 +01:00
Carbenium c8a4cc8068 TaskScheduler: use randtime instead of custom implementation
(cherry picked from commit f773bf68e0f96a97b706f366da4071ba28060b04)
2022-01-23 22:18:14 +01:00
Peter Keresztes Schmidt 44ea32ace4 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2022-01-23 22:16:15 +01:00
Peter Keresztes Schmidt ad340466d0 Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
(cherry picked from commit 85b5b842ca6c05d4e51081e6c3282940a80f3761)
2022-01-23 22:02:03 +01:00
Peter Keresztes Schmidt dfc1f08bd8 Misc: Remove some unneeded/duplicated includes (#25051)
(cherry picked from commit ddf16ae4d9eff6e849618bb6c5a00603f26daa93)
2022-01-23 20:48:12 +01:00
Peter Keresztes Schmidt 770fbcca0c Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do

(cherry picked from commit 202fd41389973322f63186fd8e5a368fce3e1b04)
2022-01-23 18:05:59 +01:00
Peter Keresztes Schmidt cd86a015c4 Core/Util: Remove EventMap's non-std::chrono::duration based interface (#25049)
Closes #25012

(cherry picked from commit ce1e2c0f9b4f80e1fa5c448ee12fec43204a3634)
2022-01-23 16:39:31 +01:00
Peter Keresztes Schmidt 54d3110ca7 Scripts/World+Pet: Use std::chrono::duration overloads of EventMap (#25017)
Contributes to #25012

(cherry picked from commit 0072fa922db1642d720c545ccc2ac095c140f0ca)
2022-01-23 16:02:35 +01:00
Peter Keresztes Schmidt ce8c0da4fe Scripts/Icecrown Citadel: Use std::chrono::duration overloads of EventMap (Part 2) (#25041)
Part 2: gunship battle and Sindragosa

Contributes to https://github.com/TrinityCore/TrinityCore/issues/25012

(cherry picked from commit 6968e7a1a1d638cc43409e7ab5e96f2e4854fe69)
2022-01-23 16:02:25 +01:00
Peter Keresztes Schmidt 0195ec8945 Scripts/Icecrown Citadel: Use std::chrono::duration overloads of EventMap (#25036)
Part 1: without gunship battle and Sindragosa

Contributes to #25012

(cherry picked from commit 5eaff8a3bcc4a81ca27e19418f0c508966ad3c7f)
2022-01-23 16:02:00 +01:00
Peter Keresztes Schmidt 253cbf5678 Scripts/Tempest Keep: Use std::chrono::duration overloads of EventMap (#25040)
Contributes to #25012

(cherry picked from commit 2d9c5979a6a6d9244f557ff5653694ce5b8f19a4)
2022-01-23 16:01:09 +01:00
Peter Keresztes Schmidt c3228cc252 Scripts/Utgarde Keep: Use std::chrono::duration overloads of EventMap (#25039)
Contributes to #25012

(cherry picked from commit f00ab389d60cd5c8ba44ec8c6a49369c70a95d8b)
2022-01-23 16:00:59 +01:00
Peter Keresztes Schmidt 8e7c368220 Scripts/Magisters Terrace: Use std::chrono::duration overloads of EventMap (#25038)
Contributes to #25012

(cherry picked from commit 88314660b66637982d629b786630af0dc0323eab)
2022-01-23 16:00:43 +01:00
Peter Keresztes Schmidt d62b7c1e35 Core/CombatAI: Use std::chrono::duration overloads of EventMap (#25037)
Contributes to #25012

(cherry picked from commit bd837d4c3dc61e7817ccb14071108e97db86f1f5)
2022-01-23 16:00:27 +01:00
Peter Keresztes Schmidt b27c70aff2 Scripts/Ulduar: Use std::chrono::duration overloads of EventMap (#25035)
Contributes to #25012

(cherry picked from commit d4bce9f4d2d6059740e5bcc146ffa8d98f715d6f)
2022-01-23 15:49:50 +01:00
Peter Keresztes Schmidt b7d5a1653d Scripts/Nexus: Use std::chrono::duration overloads of EventMap (#25033)
Contributes to #25012

(cherry picked from commit 2f538258d9e2e1162766efaee8cb61eeae4f921e)
2022-01-23 15:49:27 +01:00
Peter Keresztes Schmidt ef5f874cea Scripts/Naxxramas: Use std::chrono::duration overloads of EventMap (#25032)
Contributes to #25012

(cherry picked from commit 6eec0bc50f40892275934ae91d410b63ecbe2dfd)
2022-01-23 15:49:09 +01:00
Peter Keresztes Schmidt 65e1b79547 Scripts/Isle of Conquest: Use std::chrono::duration overloads of EventMap (#25031)
Contributes to #25012

(cherry picked from commit 1a32b0f5b3c64bad4f379a45e5e7b07f00fe774e)
2022-01-23 15:49:01 +01:00
Peter Keresztes Schmidt 3d9885a302 Scripts/Gundrak: Use std::chrono::duration overloads of EventMap (#25030)
Contributes to #25012

(cherry picked from commit 3a9b3259b8eb2f35af29135fd9c9c0c44e3e47d2)
2022-01-23 15:48:52 +01:00
Peter Keresztes Schmidt e6e4edd768 Scripts/Frozen Halls: Use std::chrono::duration overloads of EventMap (#25029)
Contributes to #25012

(cherry picked from commit 19ee4d6254370de3f174718a72e5055aa28b6102)
2022-01-23 15:48:41 +01:00
Peter Keresztes Schmidt 0c6b6acda6 Scripts/Drak'Tharon Keep: Use std::chrono::duration overloads of EventMap (#25028)
Contributes to #25012

(cherry picked from commit 65e01053a8dfa713c5ffebe6702d85a3577a9790)
2022-01-23 15:48:25 +01:00
Peter Keresztes Schmidt cd65f988bd Scripts/Chamber of Aspects: Use std::chrono::duration overloads of EventMap (#25027)
Contributes to #25012

(cherry picked from commit 42102871a78e4424ee18c243600327f5e1d84945)
2022-01-23 15:48:17 +01:00
Peter Keresztes Schmidt 5507aa2f5e Scripts/Coilfang Reservoir: Use std::chrono::duration overloads of EventMap (#25025)
Contributes to #25012

(cherry picked from commit 5ed6c6a5c348d601c6f144ca2b0df3e297dd2a69)
2022-01-23 15:48:08 +01:00
Peter Keresztes Schmidt 7f948a3e23 Scripts/Hellfire Citadel: Use std::chrono::duration overloads of EventMap (#25024)
Contributes to #25012

(cherry picked from commit d00c95f26f835e681bcadbb68a2476408948d64a)
2022-01-23 15:47:58 +01:00
Peter Keresztes Schmidt 7b766f45b0 Scripts/Azjol-Nerub: Use std::chrono::duration overloads of EventMap (#25026)
Contributes to #25012

(cherry picked from commit 1c3187e596e1d0d483b9ff7d2794ace017c16963)
2022-01-23 15:47:50 +01:00
Peter Keresztes Schmidt 5c3b3d2225 Scripts/Auchindoun: Use std::chrono::duration overloads of EventMap (#25023)
Contributes to #25012

(cherry picked from commit 4ad80434a2efa046c4f4954221832714225b801d)
2022-01-23 15:47:16 +01:00
Peter Keresztes Schmidt 1a53ac17c8 Scripts/Outland: Use std::chrono::duration overloads of EventMap (#25022)
Contributes to #25012

(cherry picked from commit 39fc17e284bf2082d3b5a0c50dfd9e6cde64b582)
2022-01-23 15:47:00 +01:00
Peter Keresztes Schmidt 5086f1bfdc Scripts/Northrend: Use std::chrono::duration overloads of EventMap (#25021)
Contributes to #25012

(cherry picked from commit 29779db58b19384518706299e6e48be0d04eac65)
2022-01-23 15:46:37 +01:00
Peter Keresztes Schmidt c56f99a1d4 Scripts/Trial of the Crusader: Use std::chrono::duration overloads of EventMap (#25020)
Contributes to #25012

(cherry picked from commit a2b2dc7ad0b22bf0f89dfc26dd7eb33fe7bcacfb)
2022-01-23 15:41:42 +01:00
Peter Keresztes Schmidt 111521d3c9 Scripts/EasternKingdoms: Use std::chrono::duration overloads of EventMap (#25019)
Contributes to #25012

(cherry picked from commit 5ef576d223db0ac019bd803a07976cdc549a26ac)
2022-01-23 15:41:30 +01:00
Peter Keresztes Schmidt 41dab047ed Scripts/Blackrock Mountain: Use std::chrono::duration overloads of EventMap (#25018)
Contributes to #25012

(cherry picked from commit ac27c922d1ac0cbae98e98a3f560484dece75604)
2022-01-23 15:39:28 +01:00
Peter Keresztes Schmidt 8fb60c4d19 Scripts/Kalimdor: Use std::chrono::duration overloads of EventMap (#25016)
Contributes to #25012

(cherry picked from commit 90d5e7e1e82f1f196fb78844f7cad81fc228877c)
2022-01-23 15:38:35 +01:00
Peter Keresztes Schmidt c76f6e0879 Core/Battlegrounds: Use std::chrono::duration overloads of EventMap (#25015)
Contributes to #25012

(cherry picked from commit e372f9badb252f67abc29236e715bcce7fe1155d)
2022-01-23 15:36:37 +01:00
Peter Keresztes Schmidt 365ae6ff25 Fix some compiler warnings reported by GCC (#25007)
* Core/AI: Remove unneeded null checks

GetMap() can never return NULL.

Fixes additionally -Wunused-variable warnings
reported by GCC.

* Core/GameObject: Fix a -Wunused-variable warning reported by GCC

* Core/Player: Fix a -Wunused-variable warning reported by GCC

* Scritps/CavernsOfTime: Fix -Wimplicit-fallthrough warnings reported by GCC

* Scritps/CavernsOfTime: Fix a -Wmaybe-uninitialized warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp: In member function ‘virtual void npc_arthas_stratholme::npc_arthas_stratholmeAI::UpdateAI(uint32)’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp:1119:58: warning: ‘emote’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1119 |                                 (*it)->HandleEmoteCommand(emote);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

* Scritps/PitOfSaron: Fix -Wunused-variable warnings reported by GCC

* Scritps/EyeOfEternity: Fix a -Wclass-memaccess warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp: In member function ‘virtual void boss_malygos::boss_malygosAI::UpdateAI(uint32)’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp:950:81: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ObjectGuid’; use assignment or value-initialization instead [-Wclass-memaccess]
  950 |                             memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID));
      |

* Scritps/CoilfangReservoir: Fix a -Wclass-memaccess warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp: In member function ‘void boss_leotheras_the_blind::boss_leotheras_the_blindAI::Initialize()’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp:220:55: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ObjectGuid’; use assignment or value-initialization instead [-Wclass-memaccess]
  220 |             memset(InnderDemon, 0, sizeof(InnderDemon));
      |                                                       ^

* Scritps/Naxx: Fix a -Wimplicit-fallthrough warning reported by GCC

For discussion see https://github.com/TrinityCore/TrinityCore/pull/25007

(cherry picked from commit 10be49bdfe6bd1f4d8e0eaf3a1b4354c5a57a2a9)
2022-01-23 00:16:31 +01:00
Peter Keresztes Schmidt 1e1679a1f7 Core/DataStores: Port refactors from Update DBC field names to generated ones (#24999)
(cherry picked from commit c92950b3e1f6366d85d707365a8ad2caddafeecc)
2022-01-23 00:06:16 +01:00
Carbenium 366a514462 Core/Battlefield: Move SendInitWorldStatesTo to Battlefield class
(cherry picked from commit 488b91ab8307e2d84cc010be488aad693dba34c8)
2022-01-07 00:25:36 +01:00
Carbenium 81a3c135a7 Scripts/Battlefield: Move npc_wg_give_promotion_credit script to BattlefieldWG
The script references BattlefieldWG, which is not exported in dynamic builds.
Move the script, so it is in the same library.

(cherry picked from commit c40b897d369cf45696ca626fdf48bf51226a73a8)
2022-01-07 00:22:38 +01:00
Carbenium 49523a74a4 Battlefields: Move BF scripts out of game
This commit introduces the usual script interface
for battlefields.

(cherry picked from commit f7faf20254a120a90b8ee8eb55a284a6351aabc3)
2022-01-07 00:20:57 +01:00
Carbenium ca62d93481 Core/Misc: Move WorldState enum to SharedDefines
Move WG battlefield world states to the global enum

(cherry picked from commit 22c12e7123d76ea584ea8542be3feea57069e997)
2022-01-06 23:50:34 +01:00
Carbenium 60b48ad046 Core/Misc: Create new enum for AreaIds
Move Wintergrasp BF related values there

(cherry picked from commit 6a8c12587eef47722f6c845f477e0ca66e9ccd1e)
2022-01-06 23:42:15 +01:00
Peter Keresztes Schmidt c4098897a8 game/AI: Convert SelectAggroTarget to enum class (#24818)
* game/AI: Convert SelectAggroTarget to enum class

* game/AI: Rename SelectAggroTarget to SelectTargetMethod

(cherry picked from commit 418c3b1fd50664aad035bd975a65281e82ba2dea)
2022-01-06 21:53:27 +01:00
Carbenium 4e44bc6ea2 Core: Fix non-PCH build
(cherry picked from commit 45cb8c90e925580be41393e7647067d27a3e75c7)
2020-08-23 17:57:07 +02:00
Carbenium 692ec8e7c1 Core/SAI: Apply include cleanups to cherry-picked changes 2020-07-16 22:00:30 +02:00
Carbenium f27b7ba285 Core/Player: Reserve TELE_TO_TRANSPORT_TELEPORT used in 3.3.5 2020-07-16 21:47:27 +02:00
Carbenium 9969d6e194 Fix non-PCH build
(cherry picked from commit 05025d79f3cb34fa135cb820badeef32883f7eb4)
2020-06-24 14:35:10 +02:00
Peter Keresztes Schmidt bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
Carbenium f387673aa3 CMake: Use target_precompile_headers instead of cotire with CMake >= 3.16.0 2020-06-16 09:29:31 +02:00
Carbenium 18ad767226 CMake: Remove guards around CMP0043 and CMP0054
We require CMake >= 3.8 which includes the policies.
CMP0043 OLD behaviour is still required by cotire.
2020-06-16 09:29:31 +02:00
Carbenium abff505a6e common: Add a missing include guard 2020-06-15 00:22:12 +02:00
Carbenium 1258800add Core/Entities: Add a missing include 2020-06-14 14:08:24 +02:00
Carbenium c6bc131b36 Add cmake-build-* directories to .gitignore since these are the default build locations for CLion 2016-11-30 21:29:10 +01:00
Carbenium 060256000b Tools/Mapextractor: Fix a vector subscript out of range debug assertion 2016-07-26 01:14:16 +02:00
Carbenium 73779d09e9 Add CLion files to gitignore 2016-06-21 21:13:32 +02:00
Carbenium d8d594d2bd IssueTemplate: Fix some engrish
Thanks tkrokli for the suggestion
2016-05-18 21:18:37 +02:00
Carbenium 2e3686b7e7 Core/Util: Add a missing include
(cherry picked from commit 1038df8d5b522e1e959528c3b7c17c01a88e7759)
2016-04-02 14:33:25 +02:00
Carbenium 541c125c2c Codestyle 2016-02-11 00:56:39 +01:00