Commit Graph
2214 Commits
Author SHA1 Message Date
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
Treeston d11c3807b3 Core/Time: Rename GetGameTime{System, Steady}Point methods
The names are a bit unhandy. Rename them (shorter but still meaningful).

GetGameTimeSystemPoint() -> GetSystemTime()
GetGameTimeSteadyPoint() -> Now()

Also add 2 new typedefs:

typedef std::chrono::steady_clock::time_point TimePoint;
typedef std::chrono::system_clock::time_point SystemTimePoint;

Closes #25042

(cherry picked from commit 896b68d5c297b06587645caebc98b704978ecaa7)
2022-01-23 21:36:03 +01:00
Shauren 596bf2b772 Core/Misc: Replace boost::optional with std::optional part 2 2022-01-23 20:31:52 +01:00
Shauren b4952db464 Core/Units: Named unit flags linked to CreatureDifficulty flags 2022-01-22 13:21:15 +01:00
jackpoz 68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0db81c0062e8c5020e07db18984d0ffa)
2022-01-19 22:17:42 +01:00
Jeremy bbed5dc3e8 Core/Auras: Store non-unit caster guids in auras (#27625)
This allows retrieving any caster object, not just units
2022-01-18 21:18:25 +01:00
Shauren 3346366b0e Core/Auras: Fixed invalid iterator access in SPELL_AURA_TRIGGER_SPELL_ON_HEALTH_PCT implementation 2022-01-17 10:31:17 +01:00
Shauren 5889ab893e Core/Units: Fixed crash happening when despawning summoned units whose owner is no longer in world
Closes #27598
2022-01-12 12:50:17 +01:00
Keader 4110a06e81 Core/Misc: Fixed resistance calculate for Mutated Transformation and Twilight Bloodbolt (#24717)
Ref: 9f7b464a6aa5b64bf5ec5c0f586853fbc71029c6
- Implemented a new SpellScript hook that allow control Resistance/Absorb amount of a damage spell.

(cherry picked from commit d81a9e5bc3b3e13b47332b3e7817bd0a0b228cbc)
2022-01-06 19:59:50 +01:00
Ovah 294657f7dd Core/Units: flight and hover checks will now consider movement template data as well as manually set flight states
- manually set flight states via auras and scripts will no longer be ignored
- restored movement template consideration when generating pathings
- renamed IsLevitating to IsGravityDisabled to reflect the referenced movement flag's name

(cherry picked from commit 43ef610fe059c3da4cc1ad2036f83cfa67ce0fee)
2022-01-06 19:46:41 +01:00
jackpoz 5af8373cce Core/Misc: Fix Clang 10 build warnings
(cherry picked from commit 48c5c0d7a2424df73343df127d415ee18eb84296)
2022-01-06 19:46:22 +01:00
Giacomo Pozzoni 9cb01a7904 Fixes/3.3.5 aura infinite loop (#24631)
* Core/Auras: Attempt to fix infinite loop with aura 18950 on map unload

* Core/Auras: Log a detailed error and assert when failing to remove all auras after a few tries

* Code cleanup

* Fix build warnings

* Fix more build warnings

(cherry picked from commit bd2d60c2676a1d7e843a2a5673b8216bad0768c7)
2022-01-04 15:33:04 +01:00
HelloKitty 406c7219ad Further improve ChrRace DBC handling (#24508)
* Core/DBC: Added ChrRacesAllianceType for ChrRaces.dbc

* Core/Character: Check ChrRace DBC playable in HandleCharCreateOpcode

* Core/DBC: Implement ChrRacesFlags removing literals

Cannot take credit for this enum, derived from documentation in
https://wowdev.wiki/DB/ChrRaces

* Core/Character: Check CHRRACES_FLAGS_NOT_PLAYABLE on creation

* Core/DBC: Fix formatting of ChrRaces enums

* Core/DBC: Use ChrRaces CreatureType instead of hardcoded humanoid assumption

* Address enum style code changes

(cherry picked from commit 43b595111dce03258c29fd926201660b9d3acb8d)
2022-01-04 15:33:04 +01:00
Shauren d30e4a20e5 Core/Misc: Define and use ChrRacesFlag and CreatureModelDataFlags (ref 772f506a3b426e27ee64b0506aed06219c8d7747) 2022-01-02 19:14:32 +01:00
Shauren d56d92fbe7 Core/Units: Allow mind controlling non-controllable vehicles (for example players that become vehicle during boss encounters or creatures that only are vehicles to show non standard power type)
Closes #24562

(cherry picked from commit 1fecbc6892b41bfe9d1e474d038c3b1f6e2dd125)
2022-01-02 16:17:18 +01:00
Shauren 6413466693 Core/Spells: Relaxed aura exclusivity check to allow casting spells that have other, non-aura effects even if aura will not be applied
Closes #24553

(cherry picked from commit 829cf38c67a70c1e0ec9886562e7ae7ae4fda17d)
2022-01-02 00:30:31 +01:00
Shauren 679e9910e0 Core/Auras: Prevent getting negative scale with auras
Closes #24040

(cherry picked from commit 50576fa1f5044ca81baf633d84174cef2346acc5)
2022-01-01 22:49:58 +01:00
Shauren c9443f190a Core/Spells Fixed scroll stacking check when not targeting self
* Reuse code that removes non-stackable auras at apply to check before casting the spell to keep reagents/cast item

(cherry picked from commit 43d9ffd1bc127768882711a47d5e2bae92845d04)
2022-01-01 22:27:05 +01:00
Ovah d18d2b84f2 Core/Objects: cache current liquid status of objects when updating position data and use it to replace unnecessary vmap lookups (#24399)
* dropped unneeded IsUnderwater override for players since the default position data update considers collision height already so we don't have to rely on that tempfix anymore. This actually fixes breathing bars showing up depending on your characters size (gnomes get their breathing bar earlier, taurens later etc)

(cherry picked from commit bea850fb73c6c3b3cc4e51bd3a42d178947882a5)
2022-01-01 12:42:17 +01:00
Giacomo Pozzoni 6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
aquadeus 9cc3cd128c Core/Auras: Implement SPELL_AURA_MOD_MELEE_DAMAGE_FROM_CASTER (343) (#27491) 2021-12-30 12:08:02 +01:00
Antonio Martín Berti b221f4b372 Core/Auras: Implemented SPELL_AURA_TRIGGER_SPELL_ON_HEALTH_PCT (#27455) 2021-12-25 17:01:17 +01:00
Meji 924182f692 Core/BattlePets: Misc fixes (#27446)
* Added script for "Summon Battle Pet" spell (118301).
* Set the saved display of the battle pet when summoning it.
* If a summon has SummonPropertiesFlags::SummonFromBattlePetJournal it will remove NpcFlag UNIT_NPC_FLAG_WILD_BATTLE_PET (Wild battle pets).
* When a creature is summoned with SummonTitle::Companion, it will check to see if it has SummonPropertiesFlags::SummonFromBattlePetJournal before updating the battle pet's update fields. (If you have a summoned battle pet and summon a creature with that SummonTitle, it will incorrectly update the battle pet's update fields with the summoned battle pet's data).
* Implemented SummonPropertiesFlags::UseCreatureLevel. If a summon has this flag, it will use the owner's level (If the summon doesn't have SummonProperties it will always use the selected level).
2021-12-25 15:27:58 +01:00
NoName 8ec51bf3b6 Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players (#24178)
* Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players
Closes ##23203 and also reverts 9a1282a

thnx to xvwyh

* Make it optional

(cherry picked from commit 6067a996324dc4e36a414257e6abf7f9dfdfa934)
2021-12-22 20:50:33 +01:00
ForesterDev aa4ee9278f Core/PacketIO: Port refactors from f6e6baa2932788b17169ba103b62a6f66ee7290a (#24200)
(cherry picked from commit f6e6baa2932788b17169ba103b62a6f66ee7290a)
2021-12-22 14:59:13 +01:00
Ovah 8f4c6ebb49 Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates (#24190)
* Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates

* pacified units should only have their melee attacks blocked as counterpart to silence mechanics

* Core/Spells: removed unnecessary attack stop call from pacify aura effect handler

(cherry picked from commit 6cbfda2fcecdda980b60b359018e520f1daeaf3a)
2021-12-22 14:47:20 +01:00
NoName 61f3d51143 Core/Movement: Implement MoveSplineFlag::Enter_Cycle (#24049)
by xvwyh

(cherry picked from commit 40542f01e3fec0bff2c6e5eadbe20e58f19b0fd8)
2021-12-22 14:33:58 +01:00
Ovah a91be4995b Core/Vehicles: implement vehicle seat addon table to specify seat ori… (#24112)
* Core/Vehicles: implement vehicle seat addon table to specify seat orientation offsets and exit positions in form of offsets or absolute positions
* converted Traveler's Tundra Mammoth to seat addon table data

* first follow batch

* whoopsie

* Core/Vehicles: go from local copies to pointers

* Update and rename 2020_99_99_99_world.sql to 2020_02_08_01_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 98d6c501d7c1a7a632c6ff8b1d46c7d0d4ae5b37)
2021-12-21 15:32:49 +01:00
Ovahlord 606597f4f8 Core/Movement: reset position update interrupt info after the interrupt checks have been executed
* for discussion see: https://github.com/TrinityCore/TrinityCore/commit/02daf1bf3afc570c26e8e9f431866fcb3720174a#r36916229

(cherry picked from commit 01584cb0b9fe623fdf5694b985a53aa45f9f1d30)
2021-12-20 23:47:37 +01:00
Ovah 43a7091e8a Core/Movement: properly fix aura interrupts during movement (#24068)
We want our movement to be fully updated before even thinking about interrupting anything. The old logic was updating positions, interrupting stuff and afterwards updating movement generators. This way we were ending up with false interrupts.

properly fixes #22908

(cherry picked from commit 02daf1bf3afc570c26e8e9f431866fcb3720174a)
2021-12-20 23:47:23 +01:00
NoName 37178ff311 Core/Spells: SPELL_AURA_48 implementation (#24054)
by xvwyh

(cherry picked from commit b3b7f0761d5605d57f9d62ca8e22a8cd9a4df24b)
2021-12-20 22:30:41 +01:00
Kelno 45585b5305 Fixed PvP Combat timer never getting refreshed (#24058)
* Fixed PvP Combat timer never gets refreshed while meleeing

* Apply Treeston feedback

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 2b024e8fbff24b071217cd88f052fdeaa48b47ba)
2021-12-20 21:25:46 +01:00
Giacomo Pozzoni d095d4afe9 Fix fleeing speed to 66% run speed (#24025)
* Core/Movement: Fix fleeing speed to 66% run speed

Fix fleeing speed to 66% run speed until the creature starts returning home

* Fix build

* Don't check speed type

* Don't apply speed reduction twice

* Fix no-pch (1st try)

* Make sure every spell focus is interrupted when seeking assistance

(cherry picked from commit 4ccf01de3947f50629c20192da3f99cb8c693b35)
2021-12-19 17:39:25 +01:00
Giacomo Pozzoni 292df30394 Core/Movement: Fix wrong orientation set when pausing movement (#23986)
* Core/Movement: Fix wrong orientation set when pausing movement

* Update MoveSpline.h

* Update Unit.cpp

(cherry picked from commit e698c17a2688385e62744cdf5eb37b12b9e304fa)
2021-12-19 15:48:43 +01:00
Giacomo Pozzoni 96ec8477f0 Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)
(cherry picked from commit 18a4cbee5eb10cf0502ffae9c89ad468a2c58012)
2021-12-19 15:31:34 +01:00
ccrs dfb2221552 Core/Movement: delay movement update in MotionMaster until its owner signals AddToWorld
ref #23199
closes #23876

(cherry picked from commit d033032d33cff5dae76000f8432d78746cda9e06)
2021-12-18 23:03:00 +01:00
ForesterDev 4a47e1c6be Core/Defines: define UNIT_FLAG_SWIMMING (#23630)
(cherry picked from commit c03c88d0c02c5dda9f14dec1ed151ca30a92118e)
2021-12-18 22:50:52 +01:00
Gildor cc0940fe25 Core/Misc: Fix parry-haste mechanic. (#23773)
* Should check victim that do a parry instead of the unit that deal the damage (Wrong implementation of this commit: 4a46fee03ef204289bbd96e8e1e07117b3bebd9f )

Closes #23754

(cherry picked from commit f8d7b260476c69e09ab0329cb7cd6c277f5473a7)
2021-12-18 21:45:45 +01:00
Giacomo Pozzoni 6d5086da17 Core/Vehicle: Change vehicle accessories' phase according to the player on the vehicle (#23646)
* Core/Vehicle: Change vehicle accessories' phase according to the player on the vehicle

* Get the root vehicle to set the phase to all accessories. Attempt to get the accessories to stay mounted on the vehicle.

* Fix the accessories to stay mounted on the vehicle

(cherry picked from commit 15e85f882fdb7b5d1d48302907e76c993ee4e923)
2021-12-18 14:08:25 +01:00
Wyrserth 2f2de26311 Core/Spell: honor IsStackableOnOneSlotWithDifferentCasters() when deciding if an aura should stack from different casters or not. (#23579)
Fixes #23387 and #22818.

(cherry picked from commit 0b87dffc3543c6953118d89b04a06fb19a1ab1dd)
2021-12-18 00:09:49 +01:00
Ovah d01a22f58e Core/Spells: fixed root behaivior of creatures that are being rooted via movement template while getting a root aura removed (#23216)
* Core/Spells: do not allow root auras to bypass the root movement template state when getting removed

* yeah....

(cherry picked from commit d629bad7a19c1f4c4cd9fb4382fadd97b320dc38)
2021-12-17 22:55:50 +01:00
Treeston 4330b7c921 Entities/Unit: fix an unrelated check from doing nothing because somebody didn't understand how type-casting works
(cherry picked from commit 0b722e23cf0cdbd7b9753ffe77b349930c34779e)
2021-12-17 22:54:01 +01:00
Treeston 970a89a8c3 Entities/Unit: Add a missing underflow check to prevent really really low damage from underflowing when paired with flat damage modifiers. Closes #23655.
(cherry picked from commit a8b1b9a3c6266d589afb378f07c505f79c75a6a4)
2021-12-17 22:50:25 +01:00
Treeston 6b1ca0ca12 Core/Combat: Properly unset engagement flag on death.
(cherry picked from commit 9c603ea87f09c47d52f093ccc73ee75c15eff6f5)
2021-12-17 22:45:55 +01:00
jackpoz e6e73b7b13 Core/Spells: Fix infinite loop
Fix an infinite loop caused by a mix of item 25498 and liquid damage

(cherry picked from commit 9b292f436903e436bfdfdc61d40d2efffad35bca)
2021-12-17 21:44:04 +01:00
Shauren e8b3dda4a0 Core/BattlePets: Wrap battle pet related code in a separate namespace 2021-12-17 14:23:43 +01:00
Treeston c13d83796f Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
(cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24)
2021-12-17 00:23:33 +01:00
jackpoz f65edd1130 Core/MovementGenerator: Add more details to asserts
Include movespline in Unit::GetDebugInfo() and the Player owner in FlightPathMovementGenerator::DoEventIfAny() assert

(cherry picked from commit 560b7e33974904938f3f85a2f78c0850df2f9333)
2021-12-16 22:03:52 +01:00
ccrs ef6a5d3c3c Core/Unit: movement related corrections prior to getting Charmed
(cherry picked from commit 294a3a2789582e05a7847620173d533bd07e44e9)
2021-12-15 23:42:06 +01:00