Commit Graph

180 Commits

Author SHA1 Message Date
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 b1a94bf94c)
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 ff26027453

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

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

* Keep MoveJump movement generator after death

Co-authored-by: ccrs <ccrs@users.noreply.github.com>
(cherry picked from commit 9fe9dc087b)
2022-03-10 23:57:14 +01:00
ccrs
0e0deaefd4 Core/Movement: remove redundant method MovementGenerator::NotifyAIOnFinalize and use existing Finalize - MovementInform implementation
6fde051e4e follow up

(cherry picked from commit 303e01c834)
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 31abdc6ecf)
2022-02-28 14:08:22 +01:00
NoName
ee620856ad Core/Movement: Corrected Animation Tier handling (PR #24875)
Co-authored-by: Warpten <vertozor@gmail.com>
Co-authored-by: Ovahlord <dreadkiller@gmx.de>
Co-authored-by: Carbenium <carbenium@outlook.com>
(cherry picked from commit dad187615d)
2022-02-05 15:40:31 +01:00
Keader
91f6163858 Core/MotionMaster: Do not generate path to MoveLand
(cherry picked from commit 141d3d2718)
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 cfd63c350f)
2022-01-01 19:17:05 +01:00
jackpoz
33e495983b Core/Movement: Add safety check to avoid C++ undefined behaviour
(cherry picked from commit 67f28adaf7)
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 <Ovahlord@users.noreply.github.com>
Co-authored-by: Ovah <dreadkiller@gmx.de>
(cherry picked from commit 0e2342c169)
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 6fde051e4e)
2021-12-23 22:32:41 +01:00
NoName
61f3d51143 Core/Movement: Implement MoveSplineFlag::Enter_Cycle (#24049)
by xvwyh

(cherry picked from commit 40542f01e3)
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 <giacomopoz@gmail.com>
(cherry picked from commit 6176ce92ea)

# 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 4ccf01de39)
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 862d47394b)
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 8f94c9ef6b)
2021-12-19 15:33:57 +01:00
ccrs
1add1c31d8 Core/Movement: prevent any Initialize queue till AddToWorld is signaled
(cherry picked from commit c9c6871659)
2021-12-18 23:18:26 +01:00
ccrs
a59e4da7f5 Core/Movement: d033032 followup
ty jackpoz

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

(cherry picked from commit bc507209a7)
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 d033032d33)
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 bec52dba3d)
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 2b78c70810)
2021-12-05 22:50:21 +01:00
Shauren
dc4b516844 Core/Movement: Use correct root check
(cherry picked from commit 3e9239a1e5)
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 99a9129a72)
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 6e011c974d)
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 11de6b5f86)
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 dbadb6369c)
2021-11-24 20:34:54 +01:00
Sorikoff
b3f75852c2 Allow walk when chasing (#23069)
(cherry picked from commit c2f2db08aa)
2021-11-24 00:02:13 +01:00
ccrs
e52be384d3 Core/Movement: 9080e7863c followup
not the desired optimization I was aiming at, ty Shauren

(cherry picked from commit 9695c3d46d)
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 9080e7863c)
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 ead439fbd6)
2021-11-12 00:16:30 +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
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
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
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
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
2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065b)
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 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
34cd11860d Core/Misc: Fixed nopch MSVC build
(cherry picked from commit e977bb4c4d)
2021-02-25 19:59:07 +01:00
ccrs
bf12bae467 Core/Misc: waypoint movement
- Creature: update current waypoint to store nodeId and pathId
- MotionMaster: change variable type on GetMotionSlotType and GetMotionSlot to keep consistency and prevent errors (ASSERT is now no longer needed)
- UnitAI: add new waypoint hooks WaypointPathStarted and WaypointPathEnded
- SAI: handle WAYPOINT related events if creature is no escorting
* SMART_EVENT_WAYPOINT_RESUMED still not implemented for no escorting

TODO: the new hooks can save, now duplicated, logic on EscortAI and SAI

closes #20777
updates #20310
updates 21bd52cb99

(cherry picked from commit e10d7dd45c)
2021-01-29 19:23:53 +01:00
ccrs
5e39572c06 Core/Movement: 7fff83d675 followup
since MOTION_SLOT_IDLE cannot be expired, signal path done and behave like IdleMotionGenerator

(cherry picked from commit eb2769996f)
2020-08-23 00:52:05 +02:00
ccrs
0a133e77d6 Core/Movement: 7fff83d675 followup
remove home position set from creature PauseMovement, and use it when necessary
change log level on DelayedDelete

(cherry picked from commit cd4775420a)
2020-08-23 00:48:46 +02:00