Commit Graph

149 Commits

Author SHA1 Message Date
bash
6620def962 auto-format 2025-11-24 11:59:06 +01:00
bash
cddd406b1c removed movementAction changed made due core movement changes 2025-11-24 11:55:03 +01:00
bashermens
d97870facd fix: warning updating movement flags while rooted (#1858)
fixes https://github.com/mod-playerbots/mod-playerbots/issues/1854
-----
Also includes fixes for:
-----
* Bots swimming with waterWalk kept switching between swimming and
walking, as result jittering effect swimming under water when water
walking active
* Bots flying close above water they would land on water and start
walking, now they stay flying unless on solid ground they will land and
start walking by design

-----
Moved all flag setting to updateMovementState:
* So all movement flag are handled in updateMovementState which also
contains the restricted movement logic.
* Handle restricted movement logic and preventing SendMovementFlagUpdate
while being restricted.


-----
Known issue when flying the following bots feel a bit jittering, wont
touch for now at least till core movement changes quirks has been dealt
with.

The current code is the extended version of what is originally was
before core merge with refactored movements. Once the core movement
refactors are settled a bit more i would like to revisit this code; as i
would expect more imperative code and less manual flag setting e.g.
bot->SetWaterWalking, SetGravitiy..SetCanFly etc.
2025-11-21 20:45:23 +01:00
bashermens
610a032379 Bots fly/follow (movePoint core refactor), water walking fixes (#1825)
Closer the original solution, i dont wanna drift to much away without
really good reason. At this point i still see NPC and bots moving
through the levels or even falling out the levels here and there. I
verified whether the MovePoint signature changes and related params
itself in playerbots has anything todo with it, even when params are
hardcoded the behavior remains. It could be deeper problem, but for now
it seems core problem. Therefore i dont wanna change to much until the
dust has settled a bit in core itself.

I havent implemented moveTakeOff or moveLand which are basically
responsible for the transitions phases between ground and air visa
versa. I have version where i use takeOff for the animation, which means
moving vertical. For now i am gonna leave for what it is.

PS: also includes additional movement fix for AreaTriggerAction which we
missed first time after the core update on movements.

@Wishmaster117 Been testing and trying a lot in the background on find
solutions and causes. The general solutions remains removed some tweaks,
altered code here and there. With the general idea to keep closer to the
original code for now at least.

Testing:
- Class abilities: Slow fall (priest), Flight Form (druid) : Green
- BG: Green
- Swimming and walking shallow waters: Green
- Takeoff and land when following master: Green
- Boat and zeppelins: Green
- Flymount and ground walking: Green
- Water Walking (shaman), Path of Frost (DK): Green
- Water Walking (shaman), Path of Frost (DK) transisions; flying,
swimming, water walking: Green


Skipping pets when group water walking, path of frost, once core pathing
changes has settled more i will add it. Which is easy but i dont wanna
add more edge cases and code branches for now.
2025-11-16 22:39:46 +01:00
kadeshar
85c7009fe1 Codestyle fix (#1797)
Warning:
Dont change this PR as draft to make it testable


DONT REVIEW UNTIL Codestyle C++ workflow dont pass
2025-11-05 21:10:17 +01:00
Alex Dcnh
286213eb8b Fix Playerbots won't fly #1753 (#1761) 2025-10-23 01:33:22 +02:00
bash
50ac6e5b95 core_merge_changes (#1747) 2025-10-20 14:12:14 +02:00
root
387c491265 fix(Playerbots): Remove auras before teleporting to prevent crash
Add RemoveAurasWithInterruptFlags call before all TeleportTo operations
to prevent race condition crash in battlegrounds.

The crash occurs when area auras (like "Entering Battleground") are
queued for removal in Aura::UpdateTargetMap's targetsToRemove list,
but the unit is deleted before the 500ms update cycle completes,
causing SIGSEGV when accessing the dangling pointer.

This fix removes auras with AURA_INTERRUPT_FLAG_TELEPORTED and
AURA_INTERRUPT_FLAG_CHANGE_MAP before teleporting, matching the
behavior in Player::TeleportTo for real players.

Affected locations:
- BattleGround join/teleport
- Spirit healer/graveyard teleport
- Corpse resurrection teleport
- Meeting stone teleport
- Master follow teleport
- RPG unstuck teleport
- Random bot teleport
- Chat command teleport

Raid-specific teleports excluded as they require separate testing.
2025-10-03 15:58:36 +10:00
bash
0cc15411c1 license update (#1674) 2025-09-30 15:19:44 +02:00
Revision
fcb956ec1b Removed unnecessary spaces 2025-09-19 22:43:50 +02:00
kadeshar
77c2354c3f Yogg-Saron strategy (#1565)
* - wip

* - Added Yogg-Saron strategy

* - Added Yogg-Saron sanity strategy

* - WIP

* - WIP

* - WIP

* - WIP

* - Added Yogg-Saron strategy

* - code refactoring

* - Code fix after pr
2025-08-18 12:02:19 +02:00
bash
8d51092d42 As requested revert for threadfixes last few days (#1552)
* Revert "[Large server fix] #1537 Serialize playerBots/botLoading with a mutex and use snapshot-based loops to fix concurrency crashes (#1540)"

This reverts commit 3fff58df1a.

* Revert "[Fix] teleport to invalid map or invalid coordinates (x , y , z  200000, o ) given when teleporting player (g UI d full type player low , name , map , x , y , z , o )  (#1538)"

This reverts commit ca2e2ef0db.

* Revert "Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)"

This reverts commit 4e3ac609bd.

* Revert "[Fix issue #1527] : startup crash in tank target selection — add TOCTOU & null-safety guards (#1532)"

This reverts commit c6b0424c29.

* Revert "[Fix issue #1528] Close small window where the “in a BG/arena” state can change between the check (InBattleground() / InArena()) and grabbing the pointer (GetBattleground()), which leads to a null dereference. (#1530)"

This reverts commit 2e0a161623.

* Revert "Harden playerbot logout & packet dispatch; add null-safety in chat hooks and RPG checks (#1529)"

This reverts commit e4ea8e2694.

* Revert "Dont wait to travel when in combat. (#1524)"

This reverts commit ddfa919154.

* Revert "nullptr fix (#1523)"

This reverts commit 380312ffd2.

* Revert "Playerbots/LFG: fix false not eligible & dungeon 0/type 0, add clear diagnostics (#1521)"

This reverts commit 872e417613.

* Revert "nullptr exception (#1520)"

This reverts commit 3d28a81508.

* Revert "Removed bot freezing at startup and system message, not relevant anymore (#1519)"

This reverts commit bcd6f5bc06.
2025-08-12 22:10:47 +02:00
Alex Dcnh
4e3ac609bd Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)
* MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full

* Update BotMovementUtils.h
2025-08-12 01:53:48 +02:00
Yunfan Li
f0c6aaff0b Random bots gear related enhancements 2025-07-05 20:29:34 +08:00
Type1Error
f55e95da9d fix(#1250): Fix movement animation desync after CC effects This fixes a bug where playerbots fail to display proper movement animations after crowd control effects wear off. When affected by movement-restricting abilities (e.g., Net-o-Matic Projector), bots would abruptly snap between positions instead of transitioning smoothly with walking or running animations. (#1264)
Fix: Better handling of CC state transitions in bot movement:
    - Added wasMovementRestricted to track CC status
    - Enhanced UpdateMovementState() to detect and react to CC ending
    - Triggered movement flag update to fix animation desync

This ensures proper client-server movement synchronization and resolves the visual bug where bots appeared to jump or skip positions. The fix restores the correct movement animation state, replicating the effect previously achieved with the reset or summon commands.
2025-05-05 15:07:16 +02:00
Yunfan Li
19447c3914 Enable new rpg strategy by default (#1192)
* Add RandomBotMinLevelChance

* Save mana only for healer

* Disable addclass dk for low level player

* Target selection and debuff cast with less players in group

* Change default rpg strategy and bots count in config

* Logs clean up

* Improve init=auto

* Remove login logs after initialization

* Rndbots stats for quest

* Prediction chase in reach combat

* Poor & Normal items ensurence for init=auto
2025-04-11 20:31:38 +08:00
kadeshar
fe519854a4 - Added skipping disperse tactic while bot is in stay stance (#1180) 2025-04-08 20:55:07 +08:00
Yunfan Li
24efa7efa2 General improvement on init and strats (#1064)
* Potions strats and potions init

* Druid and shaman spell in low level

* Ammo init improvement

* Rogue low level

* Fix melee attack action (for caster with no mana)

* Disable pet spells that reduce dps

* Talents improvement

* Remove CanFreeMove check

* Reduce penalty for non-dagger weapon for rogue
2025-03-08 12:36:06 +01:00
Yunfan Li
95c2ba9105 Permission check and readability improvements (#997)
* AiFactory check by spell instead of level

* Ignore group security for guild invitation
2025-02-23 20:09:59 +01:00
Yunfan Li
4b1febc62a Minor improvments on logs, stats weights and aoe distance calculation (#995)
* StatsCollector for paladin spell

* Remove error log on MoveFromGroup

* Log and timer for CreateRandomBots

* Improve aoe trigger distance calculation

* Reduce spirit weights for heal priest and paladin
2025-02-22 10:57:33 +08:00
SaW
2ebeb244ec Fix bot swimming behavior at the surface and in shallow waters (#908)
- Fix for Bots don't swim properly near the surface #903
- Prevents bots teleporting/warping to the surface when in (shallow) waters.
2025-01-25 16:30:47 +01:00
Yunfan Li
f6cc3f6e40 Improve ICC spread and fix Valithria trigger (#884)
* Temp fix valithria find target

* Improve spread with FleePosition

* Fix Valithria trigger
2025-01-21 20:24:06 +01:00
Yunfan Li
da1c3effb7 Fix movement after spell cast 2025-01-01 20:41:08 +08:00
Yunfan Li
1b5c6ba06a Fix FleeAction 2024-12-31 21:53:31 +08:00
Yunfan Li
cc5a3e4c76 Add backwards paramater on MoveAway (apply only on FleeAction) 2024-12-31 20:56:25 +08:00
Yunfan Li
79a5fdd7c1 Make backwards movement for flee 2024-12-29 23:21:03 +08:00
Yunfan Li
6d82b134d1 Merge branch 'master' into new_rpg_strats 2024-12-06 20:39:51 +08:00
Revision
f0ccb0a371 Fix compiler errors and switch to using available helpers 2024-12-02 00:16:06 +01:00
Yunfan Li
0fd894176b [New Rpg] New rpg start up (add GO_GRIND and NEAR_RANDOM status) 2024-11-30 23:48:29 +08:00
Yunfan Li
2cedf3f05b [Sync] Core sync 20241030 2024-10-30 21:10:43 +08:00
Bobblybook
b526a07303 Generalise dragon flanking action 2024-10-12 23:51:00 +11:00
Yunfan Li
ff68a92fe9 [Movement] Modify combat reach calculation 2024-10-04 14:14:16 +08:00
Yunfan Li
773bb7c43d [Combat formation] Fix leftover code 2024-09-27 00:22:27 +08:00
Yunfan Li
5b8d8fbf6e [Tank target] Improve position 2024-09-26 20:02:37 +08:00
Yunfan Li
8d524cdaf0 [Combat formation] Compatible with naxx and avoid aoe 2024-09-26 20:01:10 +08:00
Yunfan Li
2756664b77 [Tank face] Improve angle calculation 2024-09-24 20:34:18 +08:00
Yunfan Li
eea652f5d5 Tank face and dps behind 2024-09-24 11:46:39 +08:00
Yunfan Li
b87ca9da4c Icecrown gunship strategy 2024-09-23 14:00:24 +08:00
Yunfan Li
68bf09c425 Disable test items 2024-09-18 22:16:18 +08:00
Yunfan Li
4de02481be Avoid aoe max radius and whitelist 2024-09-08 12:53:08 +08:00
Yunfan Li
927d893945 Improve combat reach and dps target, allowing spell interruption 2024-09-06 12:33:54 +08:00
Fuzz
87745590da aq20 ossirian strat 2024-09-01 20:09:35 +10:00
Fuzz
d29569e9ea added 'move from group' action/strat/shortcut-action 2024-08-26 22:30:36 +10:00
Yunfan Li
5a576cd9a5 Config option ApplyInstanceStrategies 2024-08-19 23:55:37 +08:00
Yunfan Li
47f8eb3e4a Ulduar flame leviathan (normal mode) 2024-08-19 19:30:04 +08:00
Yunfan Li
7b0bb20078 Movement priority 2024-08-14 18:37:21 +08:00
Yunfan Li
2b35aeb049 Collision check in movement 2024-08-12 11:52:33 +08:00
Yunfan Li
65579abb47 Fix transport movement 2024-08-12 02:27:36 +08:00
Fuzz
f1bfed190c [Battlegrounds] fixed bug I introduced in PR#422 where bots alternate mount/unmount near flag indefinately, also fixed other erroneous uses of sqrt on distances 2024-08-08 21:18:52 +10:00
Fuzz
5ce49299c4 cleaned up movement code (and left comment for liyunfan) 2024-08-06 19:56:20 +10:00