Commit Graph
184 Commits
Author SHA1 Message Date
Shauren 39b76cfbc2 Core/Movement: Allow specifying timeout for follow movement 2023-03-04 14:57:17 +01:00
Shauren 0026706e83 Core/Movement: Extend MovePoint with new arguments
* Forced speed
* Speed selection mode (walk, run or default)
* Distance from target point that is considered close enough to finalize movement
2023-03-02 23:24:42 +01:00
Shauren 66b29fba44 Core/Movement: Allow specifying timeout for random movement 2023-03-01 21:58:07 +01:00
Shauren d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren ba9bbbc9d0 Core/Misc: Fixed deprecation warnings for c++20 2023-01-01 00:26:53 +01:00
Teleqraph 96295cfc5f Core/Units: Removed spline speed limit for MoveJumpWithGravity (#28142) 2022-07-24 22:20:35 +02:00
Shauren 36dde87249 Core/Movement: Delay creating MoveSplineInit objects used by GenericMovementGenerator to spline launch time
* This fixes inconsistent transport state detection for players exiting vehicles that are on transport (ICC gunship battle), fixes players being telerpoted to middle of nowhere on that fight

(cherry picked from commit b1a94bf94c500b64a5c4ae92642a95d048d9f392)
2022-06-10 15:16:39 +02:00
Giacomo Pozzoni 8111f50d03 Core/Movement: Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH (#26549)
* Core/Movement: Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH

Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH to keep movement generators even after death.

Fixes #23095
Could replace ff26027453179448bb972d88a51e565d71e95f3f

* Core/Movement: reorder new method MotionMaster::StopOnDeath

* Core/Movement: reorder new method MotionMaster::StopOnDeath

* Keep MoveJump movement generator after death

Co-authored-by: ccrs <[email protected]>
(cherry picked from commit 9fe9dc087b4dc52af7897942a83c1f880d3a4ef8)
2022-03-10 23:57:14 +01:00
ccrs 0e0deaefd4 Core/Movement: remove redundant method MovementGenerator::NotifyAIOnFinalize and use existing Finalize - MovementInform implementation
6fde051e4e52d98d1a6cf31b8ad3fcf95e0e83fd follow up

(cherry picked from commit 303e01c834d5edd1336a005a0ecf58cc82cfee1b)
2022-03-10 23:53:54 +01:00
Ovah eeac4a12f2 Core/Movement: add optional velocity argument for MoveLand and MoveTakeoff (PR #25516)
(cherry picked from commit 31abdc6ecfd84ef019880ffb531bf0298f921e77)
2022-02-28 14:08:22 +01:00
NoName ee620856ad Core/Movement: Corrected Animation Tier handling (PR #24875)
Co-authored-by: Warpten <[email protected]>
Co-authored-by: Ovahlord <[email protected]>
Co-authored-by: Carbenium <[email protected]>
(cherry picked from commit dad187615df603ad8614531a0ec84c1a5e136838)
2022-02-05 15:40:31 +01:00
Keader 91f6163858 Core/MotionMaster: Do not generate path to MoveLand
(cherry picked from commit 141d3d27185f02c300c1530d9cecb44b473e7fda)
2022-02-05 14:44:18 +01:00
Ovah a3d28efcfa Core/Movement: various improvements for creature knockbacks
* creature knockbacks will no longer generate a full path but instead only use a destination point to reflect sniff data
* calculate the destination by using a mmap raycast instead of using a mmap path which had the chance of creating weird movements when GetNearPosition failed to get a proper collision point (knocking arround a tree for example or just somewhere it should not go at all)

(cherry picked from commit cfd63c350f5b01fd699903b17162b2f5167b1386)
2022-01-01 19:17:05 +01:00
jackpoz 33e495983b Core/Movement: Add safety check to avoid C++ undefined behaviour
(cherry picked from commit 67f28adaf738ebf1377d06adac2fa30033928dd6)
2022-01-01 12:42:31 +01:00
Eridium 924116f046 Core/Movement: Formation Rewrite (#24379)
* Core/Movement: Formation Rewrite

* Add a missing include

* fixed another warning

* meh

Co-authored-by: Ovahlord <[email protected]>
Co-authored-by: Ovah <[email protected]>
(cherry picked from commit 0e2342c1698d9e2dc8a8c9d559f232cbb83707cb)
2021-12-31 19:28:14 +01:00
Giacomo Pozzoni 934c320d4b Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear (#24320)
* Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear

* Warning and no-pch build fix

(cherry picked from commit 6fde051e4e52d98d1a6cf31b8ad3fcf95e0e83fd)
2021-12-23 22:32:41 +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
ratkosrb 72093e98e1 Core/Creature: Use proper name for wander distance. (#24133)
* Use proper name for wander distance.

* Rename db field.

* Fix query.

* Remove underscore from chat command.

* Rename the handler too.

* Update chat command description.

* Fix remaining issues.

* Rename 2020_99_99_99_world_335.sql to 2020_02_16_01_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 6176ce92ea01fd33b11c2e7f8e9ebb509e80c944)

# Conflicts:
#	sql/updates/world/master/2020_02_16_01_world.sql
#	src/server/database/Database/Implementation/WorldDatabase.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/scripts/Commands/cs_npc.cpp
2021-12-21 19:50:12 +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
jackpoz 2327ff4d6d Core/Movement: Fix fleeing speed to 66% run speed
Fix AssistanceMovementGenerator using 100% MOVE_RUN speed instead of 66% . Please note that the fleeing mechanic still has some open issues that this single commit doesn't fix

(cherry picked from commit 862d47394b8c879f42902f03ecd112b65ff631c2)
2021-12-19 15:34:20 +01:00
Giacomo Pozzoni b40cadd5a1 Core/Movement: Fix stunned falling units freezing the client (#24000)
(cherry picked from commit 8f94c9ef6b843f69d014b7e3a4b3b30e5d1515e4)
2021-12-19 15:33:57 +01:00
ccrs 1add1c31d8 Core/Movement: prevent any Initialize queue till AddToWorld is signaled
(cherry picked from commit c9c6871659bf2be52b4656bc641df5211fcb928f)
2021-12-18 23:18:26 +01:00
ccrs a59e4da7f5 Core/Movement: d033032 followup
ty jackpoz

(cherry picked from commit 5d056f37c74b652b3a3372d6aa88ac5e183f9d98)
2021-12-18 23:14:40 +01:00
ccrs c658ba2fc9 Core/Movement: d033032 followup
ty jackpoz

(cherry picked from commit bc507209a706cddb33a0a14bffc94d4db50ddce6)
2021-12-18 23:03:00 +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
ccrs 6ae0a6ba22 Core/Movement: add missing parenthesis on MotionMaster::Size
pretty sure this can cause unexpected behaviour

(cherry picked from commit bec52dba3d7e4acb0b78c6a1093fe33da8205781)
2021-12-15 00:17:32 +01:00
ccrs c926184bca Core/Movement: move DelayedAction into MotionMaster and add a couple defines
(cherry picked from commit 2b78c70810cba22492b2586c6d79a90849d74ff9)
2021-12-05 22:50:21 +01:00
Shauren dc4b516844 Core/Movement: Use correct root check
(cherry picked from commit 3e9239a1e552d926caccf7e9a588e8d82ce0b9ee)
2021-12-05 14:38:39 +01:00
Shauren 34eedc2ad8 Core/Movement: Prevent rooted units from falling
* Fixes a client freeze

Closes #23042

(cherry picked from commit 99a9129a72a594cab8f3b15d9da388cf99afa47b)
2021-12-05 14:38:26 +01:00
ccrs 171947fa62 Core/Movement: replace multiset::find with std::find in MotionMaster
same reasoning as 11de6b5
Container's find uses the defined custom comparator

(cherry picked from commit 6e011c974d55135f56df7802699c05fc95ee7873)
2021-11-30 22:33:16 +01:00
ccrs 72301bf02f Core/Movement: implement and use new remove method in MotionMaster
All erases within MotionMaster are now done by itr.
Previous impl used value erase which uses the custom comparator which does not identify elements uniquely --> wrong values were deleted

ref #23187#discussion_r275791179

(cherry picked from commit 11de6b5f866e087307a719b931be8c51b984c54e)
2021-11-30 22:32:53 +01:00
Shauren 684cd9d968 Core/Movement: Implement initializing parabolic splines using jump gravity instead of max parabolic height 2021-11-27 21:56:00 +01:00
Sorikoff 956158d299 Core/Movement: Allow using walk when chasing v2 (#23073)
* Allow walk when chasing

(cherry picked from commit dbadb6369cf0b6d394fffaa1dedc612dfb5cbe2a)
2021-11-24 20:34:54 +01:00
Sorikoff b3f75852c2 Allow walk when chasing (#23069)
(cherry picked from commit c2f2db08aa4f729fbd5b21528a215f6df0c131b6)
2021-11-24 00:02:13 +01:00
ccrs e52be384d3 Core/Movement: 9080e7863c2 followup
not the desired optimization I was aiming at, ty Shauren

(cherry picked from commit 9695c3d46d752d23817da9255b1c02f79faceabd)
2021-11-21 14:17:56 +01:00
ccrs 1c5287032a Core/Movement: correct logic wrongly ported in 2a84562dc8
I'm referencing line 97 from ChaseMovementGenerator.
That commit introduced a modification in this use case:
- Chasing target is not my current victim, I should stop moving till it is my victim again
Changed To:
- Chasing target is not my current vicitm, I should stop chasing
My correction:
- I dont care about the relation of my current victim and my chasing target, I'm commanded to chase, something will tell me to stop chasing
--> Most likely: evade, new attackstart, etc.

the rest are just minor changes

(cherry picked from commit 9080e7863c28df7dc1c2af321964776e7b59e41a)
2021-11-21 14:17:23 +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 ead439fbd6620ab53530c3d1d28b4755280a1059)
2021-11-12 00:16:30 +01:00
ShaurenandSeyden 732a8ee261 Core/Movement: Corrected values sent in knockback packet when speedXY < 0
Co-authored-by: Seyden <[email protected]>
2021-11-06 23:17:43 +01: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 982643cd96790ffc54e7a3e507469649f3b074d2)
2021-09-28 00:15:13 +02:00
ccrs 0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 71188062314ee94402d9d3e228fd5b46e8865b18)
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 2a45418032233bc8779cdb44f9be6057c4b417c5)
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 bcab5bc4e7ac3866e86a54a1aa17e1174672ce75)
2021-09-26 01:43:24 +02:00
ccrs 4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc59f36ab7583432442a26b29124b7f1)
2021-09-26 01:22:17 +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 2a84562dc85516f432bb1e5de9add23c28b26ce4)
2021-09-24 23:37:43 +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 ebc96af6bb784819ba8824ac390864ae9ba12351)
2021-09-23 22:28:06 +02:00
Treeston bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2ffed5ba2a0336e9c93962b0fad9eaa)
2021-09-23 22:21:29 +02:00
Shauren 2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065ba27f0a6d278a8dd8a79b7c831e0a2b)
2021-08-24 12:44:38 +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 e42903ec16f4849b71bc8736e3151a1e11d3cd25)
2021-04-15 05:53:27 +02:00
Kittnz c6d6ece1c7 Core/Movement: Add MovePoint with facing (#20779)
(cherry picked from commit cd88406de9467127e988e4b0f7e2ba0ec787636b)
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 95456ab5d8bd623481d315ae55dfbb44b45ba9f5)
2021-03-15 20:17:31 +01:00