Commit Graph

693 Commits

Author SHA1 Message Date
ccrs
248101b458 Core/Movement: remove undefined method
(cherry picked from commit c8836b6eb4)
2021-11-15 14:15:14 +01:00
DanVS
5db7d25700 Core/Movement: Properly calculate the first Catmull-Rom spline point (#22582)
(cherry picked from commit 5e8b934472)
2021-11-13 19:52:55 +01:00
Treeston
792914fb51 Core/Movement: Add some extra assertions to MotionMaster to catch issues like #22444 earlier in the future.
(cherry picked from commit ead439fbd6)
2021-11-12 00:16:30 +01:00
Shauren
ebf8f46aed Core/Movement: Define new spline flag name 2021-11-11 21:38:05 +01:00
DanVS
8ff0572ee3 Core/Movement: Speed Limit for Spline (#22494)
* Limited speed

(cherry picked from commit 0dd3f0497d)
2021-11-11 21:36:08 +01:00
Kelno
f5c6ad9621 Core/Movement: Fixed MotionMaster::MoveChase default parameters (PR #22426)
(cherry picked from commit 7baf5b2452)
2021-11-11 20:00:41 +01:00
jackpoz
0dccffc6a0 Core/Movement: Add additional assert
Add additional assert to FlightPathMovementGenerator

(cherry picked from commit 2a06923879)
2021-11-09 23:14:28 +01:00
Shauren
732a8ee261 Core/Movement: Corrected values sent in knockback packet when speedXY < 0
Co-authored-by: Seyden <saiifii@live.de>
2021-11-06 23:17:43 +01:00
Treeston
390001fa62 Movement/TaxiPath: Properly clean up list of taxi destinations upon arrival at final node. Closes #22089.
(cherry picked from commit a3697052c3)
2021-10-31 01:39:10 +02:00
Aokromes
3621482e44 kill some whitespaces
(cherry picked from commit cc49b7bb30)
2021-10-26 23:55:38 +02:00
Treeston
852164132c Core/Movement: Some improvements to script interfaces for SplineChainMovementGenerator
(cherry picked from commit e63e0cb6fc)
2021-10-23 15:59:31 +02:00
Treeston
34f9666f20 Core/Unit: Some charm fixes:
* Properly restore react state after possession expires. Closes #20769.
* Possessed creatures now don't override player control with random/waypoint motion
* SmartAI creatures now properly re-aggress charmer after charm expires

(cherry picked from commit da21ca80fc)
2021-10-23 14:44:05 +02:00
Treeston
e4e8c1c59c Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans
(cherry picked from commit 042f5515e4)
2021-10-22 23:47:51 +02:00
Treeston
6f0e58cce0 Core/Movement: Prevent NO_PATH evades from incorrectly happening in a few places. Closes #22226.
(cherry picked from commit 86bba6421b)
2021-10-22 00:42:04 +02:00
Treeston
6d2423b733 Core/Movement: Properly resume chase/follow movement if it was paused by a spell cast. Closes #21900.
(cherry picked from commit c031167e06)
2021-10-17 01:10:25 +02:00
ccrs
6d9e544c20 Core/Movement: shield ChaseMovementGenerator against a potential crash
Since GenericMovementGenerator can be built with any MOTION_TYPE

(cherry picked from commit 98fd8d4c74)
2021-09-29 00:01:23 +02:00
ccrs
4487933bd0 Core/Movement: adjust deactivation/reset logic inside GenericMovementGenerator
Deactivated GMGenerators will now Initialize if they never did.
Mimiron's script needs still some movement love.

closes #22037

(cherry picked from commit 24a9598e2c)
2021-09-29 00:00:57 +02:00
ccrs
30583be025 Core/Movement: prevent double initialization calls if the generator was deactivated before being initialized
ref #22037

(cherry picked from commit 825c5f5ec4)
2021-09-29 00:00:26 +02:00
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Treeston
5f0f530c08 re-enable CreatureAI::MovementInform for Chase/FollowMovementGenerator - didn't realize any AI used this
(cherry picked from commit 56a056a8a5)
2021-09-26 21:17:40 +02:00
Shauren
58043c8d90 Core/Movement: Removed unneccessary z position adjustment
Closes #21872

(cherry picked from commit d9a2177e9c)
2021-09-26 16:12:52 +02:00
Shauren
9709643f50 Core/Misc: Fix copyright headers 2021-09-26 14:22:52 +02:00
ccrs
0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 7118806231)
2021-09-26 14:21:14 +02:00
ccrs
d59a6af9c6 Core/Movement: move MoveSplineInit (#21857)
The number of edge cases in which weirdness is seen on "effect movements" will be kinda reduced, plus consistency, plus movementInform on custom movement spline initalizations.

(cherry picked from commit 2a45418032)
2021-09-26 14:19:36 +02:00
ccrs
d376058dcc Core/Movement: crashfix
New movement -> Mutate -> Finish current for that slot that happens to be the same type, Follow -> Finish method on the removed movement -> UpdateSpeed call -> search for top -> crash

Closes #21861

(cherry picked from commit bcab5bc4e7)
2021-09-26 01:43:24 +02:00
ccrs
4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc)
2021-09-26 01:22:17 +02:00
Shauren
453b59de57 Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516

(cherry picked from commit b9c6bbb51d)
2021-09-25 01:04:21 +02:00
Treeston
3d9d6fbcb8 Core/Movement: Fix a potential crash on newly created pets. Closes #21791.
(cherry picked from commit 74defba5a7)
2021-09-24 23:43:30 +02:00
Treeston
1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc8)
2021-09-24 23:37:43 +02:00
Treeston
a5ae9522f3 travis fix, ebc96af follow-up
(cherry picked from commit e350cfc437)
2021-09-23 22:40:42 +02:00
Treeston
f69d12504c Core/Object: Bump hover delta handling on nearpoints downstack into GetNearPoint2D (from movement generators); functionality should be unchanged
(cherry picked from commit ebc96af6bb)
2021-09-23 22:28:06 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
Shauren
33bf5d3854 Core/Movement: Fixed chase distance calculation for hovering units
Closes #21668

(cherry picked from commit 4af3c33d04)
2021-09-19 22:43:07 +02:00
Meji
0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
Shauren
2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065b)
2021-08-24 12:44:38 +02:00
Chaouki Dhib
30cfe3741a Core/Movement: Correct distance checking
Distance checking should always be in 3D, independently on if the mover has the ability to fly or not.

(cherry picked from commit 0fb133013c)
2021-08-08 21:21:34 +02:00
ccrs
cecb91ad3d Core/Movement: fe1ba18905 followup
ref fe1ba18905 (r27507316)

plus I noticed a logic error on speedchange call

(cherry picked from commit 28c6db0807)
2021-06-20 01:34:48 +02:00
Treeston
6d79b329ac Core/Movement: WaypointMovementGenerator cleanup
(cherry picked from commit fe1ba18905)
2021-06-19 23:33:38 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Shauren
2de6e56d29 Core/Misc: Rename MapDefines.h to MMapDefines.h as it contains mmap defines exclusively 2021-05-29 14:48:18 +02:00
Chaouki Dhib
0ce1e9d652 Core/Movement: Correct the allowed distance to target before a repositioning is necessary. #20173
Also getting rid of the wordserveur config parameter 'TargetPosRecalculateRange' since it is no longer needed.

(cherry picked from commit 274dede3dc)
2021-05-16 21:56:07 +02:00
Treeston
34c7810fe5 Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.

(cherry picked from commit 532ab1c7f8)
2021-05-16 21:56:01 +02:00
Treeston
e0afca513a Core/AI: UnitAI.h trimming part two. WaypointX methods kicked upstairs to CreatureAI.h.
(cherry picked from commit 9c1e675590)
2021-04-27 23:51:40 +02:00
Jeremy
446fc391f0 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags

(cherry picked from commit e42903ec16)
2021-04-15 05:53:27 +02:00
Kittnz
c6d6ece1c7 Core/Movement: Add MovePoint with facing (#20779)
(cherry picked from commit cd88406de9)
2021-04-15 05:53:27 +02:00
Golrag
fe362cf2c9 Core/Entities: Some changes to LoS z checking & MotionMaster::MoveJumpTo (PR #20970)
- Use Midsection height for LoS checking.
- Changed MotionMaster::MoveJumpTo to use correct z. This change also makes sure the _owner will jump towards the given angle. Instead of jumping to a unintended angle if the first one is not in LoS.

(cherry picked from commit 95456ab5d8)
2021-03-15 20:17:31 +01:00
Shauren
dcca884605 Core/Misc: Really fixed nopch MSVC build
(cherry picked from commit e19bb7a1a5)
2021-02-25 20:29:22 +01:00
ccrs
045b26fe9f Core/Movement: correction on header use on some generators
(cherry picked from commit daef1493f2)
2021-02-25 20:20:29 +01:00
Shauren
34cd11860d Core/Misc: Fixed nopch MSVC build
(cherry picked from commit e977bb4c4d)
2021-02-25 19:59:07 +01:00
ccrs
88c3a184cc Core/Movement: some corrections on WaypointMovementGenerator
- Since a timer can be set on MovementGenerator::Pause, dont update it till the movespline is Finalized
- Don't set HomePosition on every Update, check if movespline is Finalized
    * This is still doesnt feel correct, should it only be called on WaypointNode Start?

(cherry picked from commit 2ce9a0a094)
2021-02-15 19:13:25 +01:00