Commit Graph

61 Commits

Author SHA1 Message Date
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
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
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
ca2e2ef0db [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)
* MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full

* Update BotMovementUtils.h

* Playerbots: guard against invalid-Z teleports
2025-08-12 01:54:17 +02:00
EricksOliveira
b7b8c60d17 Fix 2025-07-28 12:12:53 -03:00
EricksOliveira
e5f1446b9f . 2025-07-28 12:05:22 -03:00
EricksOliveira
e92029dd6e The bot immediately moves to a new position if the target is lost by LoS even during the cast. 2025-07-28 11:48:15 -03:00
EricksOliveira
b8c0a54f92 .. 2025-07-28 09:03:20 -03:00
EricksOliveira
18d1821dab Fix 2025-07-28 08:57:19 -03:00
EricksOliveira
8a8571c54f . 2025-07-28 08:45:20 -03:00
EricksOliveira
21bcbece7a Improve Bot Repositioning Based on Line of Sight and Vertical Distance
This update enhances bot behavior by adding a check for both line of sight (LoS) and significant vertical height differences between the bot and its target. If the bot cannot see its target or if the height difference exceeds 5.0f, it calculates a valid path and moves closer to regain visibility and combat effectiveness. This resolves cases where bots would previously stand still when enemies jumped from elevated terrain or were behind obstacles.
2025-07-28 08:36:28 -03:00
EricksOliveira
8a9a833c98 fix 2025-07-27 19:31:54 -03:00
EricksOliveira
101c7f3046 . 2025-07-27 18:45:04 -03:00
EricksOliveira
d8d94f33ee Improve Arena Bot Behavior When Target is Behind Obstacles
This update enhances bot behavior in arena scenarios by addressing the issue where bots remain idle if their target moves behind line-of-sight (LoS obstacles). The bot now attempts to reposition near the target to regain LoS instead of standing still, preventing situations where enemies can recover without pressure.

Could someone test it?
2025-07-27 18:35:43 -03:00
Boxhead78
3611cfbdd3 Minor Battleground tactics improvements (#1431)
* Fix bots ignoring contested Nodes in Arathi Basin

* Use VMAP_INVALID_HEIGHT_VALUE instead of -200000.0f for valid height check
2025-07-08 18:31:08 +02:00
Boxhead78
605fa223ce Move GetBotStrategyForTeam from core 2025-07-03 09:39:54 +02:00
Boxhead78
309d177dd8 Battleground Rewrite
- Refactored BattleGroundTactics.cpp
- Bots choose strategies to determine if they are more aggressive or defensive in objectives
- Largely improved bots tactics in WSG, AB, AV and EY
- Improved how bots chase flag carriers
- Fixed some bots stuck in action loops - especially in WSG and AV
- Fixed several other Bugs
2025-07-03 08:25:55 +02:00
Cryo81
07e4dec70d Warning fix + ilvl function fix (#1210)
* 1 variable order warning fixed
70 unused variable warning fixed

* Fixed GetEquipGearScore function

---------

Co-authored-by: Julien MAS <julien.mas81@gmail.com>
2025-04-20 14:26:42 +08:00
blinkysc
d770e0a9a0 fix(BotAI/BattleGrounds) Bots AI improved based around capture points (#927)
* Less Flag Derp

* Comments
2025-01-30 14:16:59 +01:00
avirar
27b86f8b1f Eye of the Storm changes (#924)
* EoTS: Changed FC logic to use MoveNear while not in combat

Similar to WSG commit from a few days ago

* Changed action priorities in EotS to ACTION_MOVE + x

* Adjusted EotS flag carrier objective selection

Random chance reduced from 1/2 to 1/3
Distance threshold before objective switch is considered reduced to 15.0yds
2025-01-30 14:16:34 +01:00
avirar
f27624aa6e Removed mount action in "protect fc" + reduced support bot chance (#892) 2025-01-23 11:42:31 +01:00
avirar
1e9fd1607a Tweaked Alterac Valley so bots kill final bosses (#886)
* Updated AV strategy so only 2 towers need to be down before final boss

* Adjusted role assignments for AV: less defenders, more forward attackers

* Added strategy for team has flag in WSG

team has flag triggers bg protect fc action @ 75 priority

* Updated protectFC function with MoveNear instead of follow
2025-01-22 16:45:09 +01:00
Fuzz
780934a9e4 potential fix for #94 (not 100% sure as can't reproduce) 2024-08-15 21:15:07 +10:00
Fuzz
520633b4b9 [Arena] self bot now leaves finished arena game reliably (may also fix issues with other bot types leaving arena or all bot types leaving BG's but I wasnt able to reproduce any 'bots stay in bg/arena' bugs except self-bots in arena) 2024-08-15 21:14:20 +10: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
27c5d6b19c [Battlegrounds] fix for #424 - flag carrier not fighting back when enemy has flag too and bot is hiding 2024-08-07 23:40:19 +10:00
Fuzz
45ebef049f [Battlegrounds] wsg pathing fix for #442 2024-08-06 22:21:55 +10:00
Fuzz
af674e9361 [Battlegrounds] many IOC fixes: fixed bots not being able to revive in their own base GY, fixed bots not able to use flags in IOC at all (couldnt cap anything), added path so bots could reach boss and several other paths too, fixed horde bots not being able to tell that alliance gate is down (stayed outside forever), fixed bots not able to get in vehicles, fixed bots not able to drive vehicles, fixed bots in vehicles becoming unresponsive after a fight (in-combat status seems to never clear in vehicle which may be AC bug), reduced bot 'agro distance' when in vehicle so they can get to their objective, redid selectObject strat completely, prevented bots using cannons (bots are useless in them) and catapults (they dont know how to use them), prevented bots using Glaive Thrower's Blade Salvo as it's bugged (and stops them using any attacks after they use it), many other fixes 2024-08-06 19:26:54 +10:00
Yunfan Li
53611c9040 Run clang-format 2024-08-04 10:23:36 +08:00
Fuzz
c050c69884 [Battlegrounds] additional change I meant to include last commit 2024-08-02 17:17:22 +10:00
Fuzz
ff6106bf8d [Battlegrounds] bots will no longer hide within flagpoles when capping points in AV AB or IOC 2024-08-02 17:05:16 +10:00
fuzzdeveloper
0a015cae2e Merge pull request #410 from fuzzdeveloper/eots-fixes
EOTS battleground fixes
2024-07-30 09:19:00 +10:00
Fuzz
1855f0beae Merge branch 'master' into eots-fixes 2024-07-29 22:33:33 +10:00
CrypticAvacado
804c3adbd3 Fix formatting and use correct value data type 2024-07-29 20:45:00 +12:00
Fuzz
0e129f315e [Battlegrounds] EOTS - improved path selection, bots no longer just hide near spawn when they have flag but no objective (they try to take to neutral or enemy point with to capture both point then flag), bots now defend points on their side of map more aggressively 2024-07-29 13:03:01 +10:00
CrypticAvacado
a01302f348 Improve arena positioning based on class 2024-07-29 03:26:14 +12:00
Fuzz
9a3f513cc8 [Battlegrounds] bots now jump down from starting platforms in EOTS, fixed assymetric flag cap strategy between teams 2024-07-26 15:17:16 +10:00
Yunfan Li
bc784b2b94 [Warning] Fix warnings 2024-07-24 23:54:28 +08:00
Fuzz
649e8a1d4a [Battlegrounds] fixed main EOTS issues (teleport bots off starting platform, fixed incorrect BG objective for the bases), still some minor pathing issues present 2024-07-24 16:32:36 +10:00
Fuzz
d1f8b2f9dd [BattleGrounds] fix for mac/linux build failing 2024-07-22 16:03:12 +10:00
Fuzz
be551a5618 [BattleGrounds] just a few little fixes before PR 2024-07-22 15:50:05 +10:00
Fuzz
c69d828a51 Merge branch 'master' into more-av-fixes 2024-07-22 14:26:01 +10:00
Fuzz
6417e836e1 [BattleGrounds] Bots no longer needlessly dismount in BG's when near a creature (eg: AV rams). AV: attacking bots now concentrate on final GY and boss when all enemy towers are down (prevents them running back to previous GY's when they should just down the boss), attacking bots now try to get first enemy GY before first tower (helps alliance), bots respawning in cave starting area's now leave cave before selecting path (they were making bad selections due to all paths starting too far away from spawn point, defending horde bots would try to clip through walls and go directly to horde base GY), new path to get from horde cave to horde base (prevents horde defenders trying to scale the hills/walls to get in), overall balance between teams much improved. new playerbots debug bg commands (that I used to develop/test these changes) 2024-07-22 09:02:00 +10:00
Revision
838bfe333d Fix: Updated to work with newer commits of AzerothCore 2024-07-22 00:39:06 +02:00
Fuzz
75daad5bec fix wrong NPC for vanndar, upped bots gathered before taking out captain because alliance was struggling 2024-07-16 20:23:10 +10:00
Fuzz
f854726934 fixed defenders sitting in burning building lamenting their failures, some attackers now advance to next objective without waiting for full capture, added new path for alliance to bypass mid on the way to galv, made objective selection logic same for both teams 2024-07-15 20:44:36 +10:00
Yunfan Li
266aa1ec88 [Warnings] Fix warnings 2024-07-13 11:41:16 +08:00
Fuzz
3316490f5d many many fixes for AV - fixed main path from horde cave starting too far away (flying bots, or bots going nowhere), fixed wrong objects targetted for objective-nodes (bots hanging around already captured points), wrong creatures targetted for boss and captain (bot running toward and away from captain, bot capturing every point then running home), wrong flag state checked for certain points (bot waiting forever in burning tower), fixed bots not moving close enough to flags in towers (bots sitting in towers forever), and more 2024-07-10 22:36:22 +10:00