Commit Graph
100 Commits
Author SHA1 Message Date
jackpoz 4431df1f13 Core/LFG: Sanitize LFG roles sent by clients
(cherry picked from commit 3778f23c579ad1050c2b985b5f42b365a7736c24)
2022-01-06 23:31:40 +01:00
jackpoz ebe183ea93 Scripts/VioletHold: Limit the number of current summons before the waves start
(cherry picked from commit 54e30d4ebae11e0c8da77af6104a3cc0a6a11365)
2022-01-06 23:15:59 +01:00
Giacomo Pozzoni 07f42907c6 Log number of Creatures and GameObject per map (#24809)
* Shared/Metric: Allow to specify tags in metrics

* Core/Metric: Log number of Creatures and GameObject per map

* Apply feedback

* Codestyle changes

* Codestyle changes

* Remove whitespace

* Update Grafana dashboards to v7.0.3

* Fix missing filter on realm

* Include Creatures and Gameobjects in Maps dashboard

* Show instances with a different color

(cherry picked from commit 4e1dbd1cf808c9cf1f310b6d498f7e304dfb4147)
2022-01-06 23:15:07 +01:00
jackpoz 5886bf7484 Scripts/Commands: Add .debug objectcount <optional map id> chat command
Add .debug objectcount <optional map id> chat command to show the number of Creatures and GameObjects

(cherry picked from commit cd37a17103b88a56ec1fde2156c4325b74989e08)
2022-01-06 20:49:28 +01:00
jackpoz 9286734b55 Core/Misc: Fix static analysis issues reported by Coverity Scan
(cherry picked from commit adc7cd3ceec969488cd8d8fa93edc281f0169102)
2022-01-06 19:47:51 +01:00
jackpoz 5af8373cce Core/Misc: Fix Clang 10 build warnings
(cherry picked from commit 48c5c0d7a2424df73343df127d415ee18eb84296)
2022-01-06 19:46:22 +01:00
jackpoz 9e0e52f023 Scripts/Misc: Fix issues reported by ASan
(cherry picked from commit 013301088d862f634cd5b817cb3949c58454f924)
2022-01-06 16:22:58 +01:00
Giacomo Pozzoni 07863a7a68 Core/Creature: Allow to disable HP regen in Raids even if the target is unreachable (#24646)
(cherry picked from commit 247564a7ab7dc6f640bb8f4fd32c30ffdc9076d2)
2022-01-06 16:12:51 +01:00
Giacomo Pozzoni feb36f3f7d Tools/MMAPs: Show an error when running mmaps_generator built in Debug mode (#27412)
* Tools/MMAPs: Show an error when running mmaps_generator built in Debug mode

* Fix GCC build

(cherry picked from commit 8c80f28581646af110c4d2b316209ef291a95587)
2022-01-04 20:44:26 +01:00
jackpoz 071a8b5b7d Core/Misc: Remove whitespace
(cherry picked from commit 869fb748cd4f80b65b154fbd3cb9fa4ee8d64672)
2022-01-04 20:44:26 +01:00
jackpoz be7acb2527 Core/MMAPs: Reduce chances of breaking tile connections
Reduce chances of breaking tile connections caused by floating point rounding issues.

(cherry picked from commit e615e2ddefd2c18b6dec8e08fb3d17580b64ea99)
2022-01-04 20:44:26 +01:00
Giacomo Pozzoni 1ba940b17a Core/Maps: Change .map file version from FourCC to uint32 (#26326)
(cherry picked from commit 42877e75e2a67514dfeb185661e4f397b6eb044a)
2022-01-04 20:44:25 +01:00
Giacomo Pozzoni 89e183704c Improve multithreading of mmaps_generator (#25625)
* Build/Misc: Add a few *San CMake flags

Add the following flags for the related tools:
- MSAN for Memory Sanitizer
- UBSAN for Undefined Behavior Sanitizer
- TSAN for Thread Sanitizer

* Remove unused parameter

* Fix UBSan reported issue

* Disable G3D buffer pools when using Thread Sanitizer as it has its custom locking mechanisms

* Code cleanup

* Move threads from maps to tiles

* Move tile building logic to TileBuilder class

* Fix memory leak in TileBuilder

* Fix build

* Store TileBuilder as raw pointer for now, it will be changed later on to use modern C++ constructs

* Fix crash on shutdown

* Revert pvs-studio change

* Fix generating 1 single tile not closing the program

(cherry picked from commit a4e93d779c9638bc0a61cb4405ef28cb935d1065)
2022-01-04 20:44:25 +01:00
jackpoz 3820aabcd8 Core/MMAPs: Restore single slope angle of 55°
Re-generating MMAPs IS required.
Partially reverts 995a443da219ec773febd7dd29d18f3cefaa1f3b .

Having 2 different slope angles of 55° and 85° created too many polygons to fit in the current mmtile structure. This caused some polygons to become disconnected from each other, creating the old "invisible walls" effect. Because of this and because of the performance hit when loading a mmtile caused by the increase of polygon numbers, this commit reverts the recent changes and sets by default the slope angle to 55°.
Feel free to restore the previous behaviour by running .\mmaps_generator --maxAngle 85 --maxAngleNotSteep 55 , specifying the map id as number if a single map should have different slope values.
This is the last commit that will change MMAPs version to force re-generating them. Any future change that will affect only the generation settings will be optional (but recommended).

(cherry picked from commit 3947e4cb57d4c6adb78cd3cb52718bb88add91fc)
2022-01-04 20:44:02 +01:00
jackpoz ddcbc01a65 Core/MMAPs: Fix small steps being considered as NAV_AREA_GROUND_STEEP
(cherry picked from commit 3ac1992afbeb1cd7669b300b8ee4131d39f35595)
2022-01-04 20:44:02 +01:00
Giacomo Pozzoni 782a943b38 Tools/MMapsGenerator: Add some more input parameters to improve mmaps load performances (#25520)
* Some research about mmaps load performances

* Tools/MMapsGenerator: Add some more input parameters

Add some more input parameters which affect the resulting mmaps:
- --smallOutputSize: sets both walkableSlopeAngle and walkableSlopeAngleNotSteep to 55°, reducing by a lot the .mmtile size and the number of polys. A rcFilterLedgeSpans() call is included too to filter out some polys. Default to false.
- --maxAngle: Restore this parameter removed some commits ago. Specifies the max walkable angle of a Creature when in combat. Default to 85
- --maxAngleNotSteep: Max walkable angle of a Player and of a Creature out of combat. Must be less or equal than --maxAngle. Default to 55.

A performance profiling comparison highlighted that .mmtile load grows exponential with the number of polys. A small server with GridUnload enabled and without preloading all grids on startup will be more affected than a big server with GridUnload disabled and preloading grids on startup.

(cherry picked from commit b6e205f7ef32f7b82644043d82a808e67cc9acb2)
2022-01-04 20:44:02 +01:00
Giacomo Pozzoni d58d0e895c Handle different slopes in mmaps (#24765)
* Tools/MMAPs: Remove input argument --maxAngle

Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around.

* Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP

Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] .
NAV_AREA_GROUND is used for ground with range [0, 55] .
NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND.

* Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile

* Core/PathFinding: Implement NAV_GROUND_STEEP flag

Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading.

* Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND.

* Allow mobs in combat to walk on steeps up to 80°

* Allow mobs in combat to walk on steeps up to 85°.
Disable rcFilterLedgeSpans() filter as it removed long steep spans.

* Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them

* Revert last commit

(cherry picked from commit 995a443da219ec773febd7dd29d18f3cefaa1f3b)
2022-01-04 20:44:02 +01:00
jackpoz bafd22104c Tools/MMAPs: Output the time spent in a human readable format
(cherry picked from commit 6e34e07c48000e666ec15b26682eb15fb2f5f901)
2022-01-04 20:44:00 +01:00
Giacomo Pozzoni 9cb01a7904 Fixes/3.3.5 aura infinite loop (#24631)
* Core/Auras: Attempt to fix infinite loop with aura 18950 on map unload

* Core/Auras: Log a detailed error and assert when failing to remove all auras after a few tries

* Code cleanup

* Fix build warnings

* Fix more build warnings

(cherry picked from commit bd2d60c2676a1d7e843a2a5673b8216bad0768c7)
2022-01-04 15:33:04 +01:00
Giacomo Pozzoni 89afeed41b Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues (#24539)
* Core/MMAPs: Adjust walkable climb

Adjust walkable climb as recast using walkableClimb also to find the poly from a position, giving priority to polys that are below the position but closer than walkableClimb.

* Temporarily disable static collision (the whole check should be removed)

* Core/Spells: removed deprecated mmap path check for TARGET_DEST_CASTER_FRONT_LEAP

* Core/Objects: allow flying units to use the helper as well (flying units casting radius based spells)

* Code refactor

* Handle raycasts that end in a point with no height in the mmap mesh as PATHFIND_NOPATH

* Walk back a bit from raycast hitpoints as sometime the 2D result point is outside of the polygons due to floating point errors.

* Remove whitespace

* Revert 4a197ba22a as a raycast point path should have the Z retrieved with getPolyHeight(). Raycast will only return a 2-point path with Start and Hitpoint/End

* Cleanup PathGenerator raycast case

* Fix PathGenerator raycast broken if start and end are on same poly.
Fix PathGenerator raycast broken if no wall is hit.
Remove unused case of using raycast with an existing previous path (can be added back properly if needed).
Remove forcing poly length to 2 when we actually have already the right number.

* Use closestPointOnPolyBoundary on the second try of finding a point on poly for raycast.
Note that in this case the mesh height is not used which might cause issues. The poly boundary height will be used instead.

* Handle cases where getPolyHeight() fails because the point is on polygon border (and caused by floating point imprecision)

* Add far from poly flags

* Set PATHFIND_INCOMPLETE in raycast case if startFarFromPoly or endFarFromPoly

* Fix blink close to walls with no valid polygon behind the wall

* Require to re-extract mmaps

Co-authored-by: Ovah <[email protected]>
(cherry picked from commit c0b75bf40da8b447a2f3533dabbfad9eba7c6ea1)
2022-01-04 15:33:04 +01:00
jackpoz 79250cb0df CI/CircleCI: Switch to Ubuntu 20.04 and MySQL 8
(cherry picked from commit e3dfab52a639275ea130d279f4a6fe4312d34b06)
2022-01-02 21:29:32 +01:00
Giacomo Pozzoni 528e9959e8 DB: Add drop script compatible with MySQL 8
(cherry picked from commit 7e5c1cf453972e142613ab828b75c8635edf697d)
2022-01-02 19:55:05 +01:00
jackpoz 7d632d5711 Core/PathFinding: Fix buffer overflow
(cherry picked from commit dc7856644f48d6b313e973197fed69ef56d6b5e0)
2022-01-01 22:59:49 +01:00
Giacomo Pozzoni 63e5092f14 Build: Add support to MariaDB 10.4 on Windows
MariaDB 10.4 (latest stable) is the only supported version.

(cherry picked from commit 7c91c423d05aabc18d5c36af9ecc2a9c5f49970d)
2022-01-01 20:16:37 +01:00
jackpoz d690648bce Scripts/BWL: Fix crash in Razorgore encounter
(cherry picked from commit 7b8b02c32ebfb7c8c47ac1d1b94129c91346ad66)
2022-01-01 20:13:04 +01:00
jackpoz e71352db6f Core/Spells: Fix assertion triggered
(cherry picked from commit 740afc71358c32257540350a6d7d4071a851452f)
2022-01-01 20:11:02 +01:00
jackpoz 7eff81f9db Core/Pools: Fix crash on startup
(cherry picked from commit 9cde3ffd1404e784406f385061f4df0f6b429b61)
2022-01-01 14:34:20 +01:00
Giacomo Pozzoni 97c1d01cbb Core/Pooling: Remove respawn times from the database when despawning a pool (#24422)
* Core/Pooling: Remove respawn times from the database when despawning a pool

Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.

* Remove respawn time of active pool objects even if they are not spawned

(cherry picked from commit 4f33fd3932d362466ee017111895bf14fcc79c88)
2022-01-01 14:02:00 +01:00
Giacomo Pozzoni a947ee1912 Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects (#24416)
* Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects

* Include new Coalesce(..) template by @Shauren

(cherry picked from commit 90b00288c24dfefccb338bd33b025cf85e82076d)
2022-01-01 13:06:27 +01:00
jackpoz 68d947d42f Core/Log: Log all character kicks to "network.kick" category
(cherry picked from commit 31018c36527755166d8a297ac9e6c98a66f014ae)
2022-01-01 12:56:24 +01:00
jackpoz dbb0f399fa Core/NetworkIO: Adjust more packet throttling values
Thanks @Nefertumm at https://github.com/azerothcore/azerothcore-wotlk/commit/f5e38a7f5797dc04b2fd5a6710aabd9780751339 for the heads-up

(cherry picked from commit 68fcd592f8c164d1720fda147d37960362194306)
2022-01-01 12:44:07 +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
jackpoz d0e1794d99 CI/Circle CI: Show codestyle instructions
Show a short comment about how to fix the codestyle errors

(cherry picked from commit dcd2ffdaf4c358dbbab7915ab744871e5a7cc4ad)
2022-01-01 01:07:15 +01:00
jackpoz 95de1db5fc Scripts/Guards: Fix spell cast spam after killing npc_air_force_bots guards
(cherry picked from commit 0844ad2ff00fef9fe90633eea3df8afc8a58e6d1)
2022-01-01 01:02:17 +01:00
jackpoz f1f8af9c5f Core/Misc: Replace tabs with spaces
(cherry picked from commit cb41c8828fe450e78fad0300fe0cb154d57cae9f)
2022-01-01 01:01:42 +01:00
jackpoz da25846615 CI/Circle CI: Add codestyle check
Tabs are not allowed, use 4 spaces instead

(cherry picked from commit 5f29577f63da506d8099c9a09b1565e4f5d9eeaf)
2022-01-01 01:00:44 +01:00
jackpoz ecdc387df2 Core/Misc: Remove whitespace at the end of lines
(cherry picked from commit caae3886d24adf0a5fc95454bb1c45477057bde4)
2022-01-01 01:00:26 +01:00
jackpoz 4df9ab2a3f CI/Circle CI: Add codestyle check
Whitespace at the end of lines is not allowed

(cherry picked from commit 0017c7a0829d12529aac690470bddfa6b5e6bc71)
2022-01-01 00:52:28 +01:00
Giacomo Pozzoni a9e325f6b7 Core/Logs: Log full guid instead of just low guid, part 2
(cherry picked from commit 3def52c1c459f566ab2b2d8cf017c70df4d7cf22)
2022-01-01 00:51:54 +01:00
jackpoz 363db46c43 CI/Circle CI: Add support to multiline regex
(cherry picked from commit 4f88be63e7551288f37e51928614cf14d99b444f)
2021-12-31 21:58:08 +01:00
Giacomo Pozzoni 6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
jackpoz e485932c45 CI/Circle CI: Add codestyle check
ObjectGuid::GetCounter() should not be called in logs, use ObjectGuid::ToString().c_str() instead
(cherry picked from commit af1260c40e333e0d2d506128099f8263f5f2304f)
2021-12-31 21:56:38 +01:00
jackpoz 8878ba2dca CI/Circle CI: Enforce codestyle checks
(cherry picked from commit 32c9f1c7a228db33110ab0ab5975ba37cba85106)
2021-12-31 21:56:38 +01:00
jackpoz 8d2509eee5 Build/CMake: Code cleanup
(cherry picked from commit 404dbcdcf6bd09202cf58a4064a127e7f303b9b2)
2021-12-31 21:56:38 +01:00
jackpoz 89cb6bc683 Core/Battleground: Attempt to fix a crash
Please report this error if you get it

(cherry picked from commit d1f9cf84a5fa4a91b70e7d9769a3f41ba8a94a9c)
2021-12-31 20:33:52 +01:00
jackpoz 37543109f6 Core/Movement: Don't start a spline with just 1 point in FlightPathMovementGenerator
Don't start a spline with just 1 point in FlightPathMovementGenerator. This happens when teleporting to a BG while on a taxi after second last node but closer to last node.
In this case the Player will be teleported to the last node.

(cherry picked from commit ec495764918506193a51f00247adb432b1ba6646)
2021-12-30 20:59:20 +01:00
jackpoz 040af829ca Core/Movement: Improve log when starting a spline with invalid arguments
Improve log when starting a spline with invalid arguments, for example when starting a spline with just 1 point.

(cherry picked from commit 296f6aab402407a2798f3a300b256cc75d59fec4)
2021-12-30 20:58:53 +01:00
jackpoz 4e0da6f7d1 Core/Spells: Fix missing "Inventory is full" with spells that create more than 1 item
(cherry picked from commit 2a41755b589f215c14c85b1015e71534c1e91a98)
2021-12-24 00:46:45 +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
jackpoz c397d49a22 Core/Mail: Validate mail subject and body
(cherry picked from commit de923fedc931cec6e95cb210c776669a45c19e5e)
2021-12-23 21:11:29 +01:00
jackpoz 807df411ae Core/Channels: Limit channel length only for custom channels
(cherry picked from commit 3fb41da57c5f6aea04f8e0b02056a6313575b764)
2021-12-23 21:10:46 +01:00
jackpoz 7d8926c55d Core/Channels: Limit channel length to 31 characters
(cherry picked from commit 2707877cf6ab34727c348190ca15499ef0205b1c)
2021-12-23 19:45:40 +01:00
jackpoz c03af362c6 Core/Scripts: Show a message when aborting because two scripts have the same registered name
(cherry picked from commit 96df3b7adb02f763aaaa6138922bd032a75a9b9e)
2021-12-22 22:57:34 +01:00
jackpoz 1fa4403b8c Core/Common: Allow to show a message when aborting
Add a new ABORT_MSG macro that allows to show a formatted message before stopping the executable

(cherry picked from commit 0ddee8a4a03fb5c7ee8d18144ca21cd2baad6f01)
2021-12-22 22:54:18 +01:00
jackpoz c75d75b9fa Core/AI: Fix charmed Creatures with SAI scripts not starting waypoint paths
(cherry picked from commit 49e77d7c9e4c39296536cd0b2d427d047e762f46)
2021-12-22 22:36:39 +01:00
Giacomo Pozzoni 7779a33142 Core/Combat: Improve sanctuary combat stop (#24266)
Stop combat when a Player moves to a Sanctuary area only if there is any PvP combat (it would be nice to keep PvE combat but that's still an issue)

(cherry picked from commit c7974bdf909ceb34821fa3953ef4cb090282fcdf)
2021-12-22 22:36:20 +01:00
Giacomo Pozzoni 1529fe1064 Core/Database: Fix build with Maria DB on some distros (#24248)
(cherry picked from commit 0752584856b0d9c2a1a5b179cf90d3bc765fa2c1)
2021-12-22 21:45:46 +01:00
Giacomo Pozzoni 6770987d6f Core/Objects: MovePositonToFirstCollision will now use detour raycasts to determine terrain obstacles (#24232)
* Core/Objects: MovePositonToFirstCollision will now use detour raycasts to determine terrain obstacles

* Added missing includes

* Update Object.cpp

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit d1080af8db63c78986a7fcc94fcfb2fdfe817734)
2021-12-22 21:44:01 +01:00
jackpoz d89671dd59 Core/PathFinding: Fix mmaps raycast without hit
Update Z coordinate of end position when casting a mmap raycast that doesn't hit the target

(cherry picked from commit 16ccc17621313e5c954f26ad23b15392fe06e763)
2021-12-22 21:41:53 +01:00
jackpoz dab7e5688c Core/AI: Fix remaining charming issue
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on)

(cherry picked from commit 69809d12031d055d8d0cffb5a187d9af09dd0efe)
2021-12-22 21:00:14 +01:00
Giacomo Pozzoni 93e66f3f3e Core/AI: Allow creatures to evade (#24221)
* Core/AI: Allow creatures to evade

Revert changes that didn't allow creatures to evade anymore no matter how hard a script would try

* PArtially revert 163f44c1b08cc043b114585922bd08664434bf92

(cherry picked from commit 817ae5bca6db14c9b3db7d5268511525e0cb4105)
2021-12-22 21:00:05 +01:00
jackpoz 8fdeaa2797 Core/Misc: Fix build
(cherry picked from commit 9ba4694ff29a9b782625fb88a528675f2d6a115c)
2021-12-22 20:46:35 +01:00
Giacomo Pozzoni 144cfc2bce Core/AI: Make charmed creatures follow their owner (#24195)
* Core/AI: Make charmed creatures follow their owner

* Follow the charmer only when applying the charm

* Make SmartAI follow the charmer

(cherry picked from commit ddf2f60c1317f0ce728d5894064f51251cf71c72)
2021-12-22 20:46:17 +01:00
Giacomo Pozzoni 3729c76523 Core/PathFinding: Add support to WorldObject pathfinding (#24207)
* Core/PathFinding: Add support to WorldObject pathfinding

* Handle Unit* specific code

* Fix some wrong const

* Fix no-pch build

(cherry picked from commit c0676a48f70923994e00629d775f4bfef1007155)
2021-12-22 15:07:12 +01:00
Giacomo Pozzoni 313b9d2531 Core/PathFinding: Return raycast hitpoint when specifying straightLine (#24206)
(cherry picked from commit 6443e518cfa110434617c26f949b6783fe4d10d3)
2021-12-22 14:59:46 +01:00
jackpoz 2f30a9986c Tools/MMaps: Fix strange paths in Blackfathom Deeps
Increase the agent height by x2 to reduce the chance of having underground mmap layers wrongly picked by recast.

(cherry picked from commit 3b0a89a2ea76157156c03262bc86f024a1d4ca57)
2021-12-22 13:03:21 +01:00
jackpoz a5b4d0c539 Core/Movement: Add support to cyclic splines to GenericMovementGenerator
GenericMovementGenerator sets the _duration to the return value of spline.Launch(). For cyclic splines, this is the duration of 1 single cycle, while the spline itself never ends.
To support this edge case in GenericMovementGenerator we just never update the _duration timer for cyclic splines.

(cherry picked from commit 7a57029d8fd46c0966eb32b17019291785e61f37)
2021-12-22 12:21:58 +01:00
Giacomo Pozzoni fe489e2be1 Build: Enable and require c++17 (#23868)
* Build: Enable and require c++17

* Build: Raise Visual Studio version from 2017 15.2 to 2017 15.9

* Build: Raise GCC version from 6.3.0 to 7.1.0

* Reduce branch differences

* Fix build after latest merge

* Cleanup after latest merge

(cherry picked from commit 726d5e91b55d4742dcbd6b0a82d84788dbb117b7)
2021-12-21 01:20:51 +01:00
Giacomo Pozzoni f1f1bc01ba Core/Movement: Fix WaypointMovementGenerator ignoring EscortAI::SetEscortPaused() on Gossip Hello (#24005)
Fix WaypointMovementGenerator ignoring EscortAI::SetEscortPaused() when talking to a NPC, scheduling a 3 minutes pause on the WaypointMovementGenerator even if it was already disabled with no timer, waiting for the player to select a gossip entry to resume the movement.

(cherry picked from commit a9e534762f2517a37d595cdfef527ab55b6339ba)
2021-12-21 00:46:32 +01:00
jackpoz 0ed58b0952 Core/MMaps: Handle path on same position
Handle path on the same polygon between 2 very close positions as a normal path.

(cherry picked from commit d293dd37822d93f9023d3ff9d39052ed976e236b)
2021-12-20 23:16:21 +01:00
Giacomo Pozzoni 1a070fd127 Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24083)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon

Second try of handling paths on same poly in a better way than just building a shortcut

* Fix movement generators using paths with start/end positions far from mmap polygons

* Include flag PATHFIND_FARFROMPOLY even with a normal path if start or end were far away from mmap poly

(cherry picked from commit 67d9d04d63cc74196059646b2e57f50a4a4fd2ca)
2021-12-20 23:15:54 +01:00
jackpoz 4bab876fe4 Core/PathGenerator: Temporarily revert 29bf280e3496cf13c24ccb20e37da29d3bfa74d9
Temporarily revert 29bf280e3496cf13c24ccb20e37da29d3bfa74d9 since our recast implementation always expects a path to have different polygons.
A proper fix will be implemented later on, splitting a path with 1 single polygons in smaller steps in a similar way of how FindSmoothPath() works

(cherry picked from commit 9f8477cd112bf0f52e23afc9cdee4adfcf540de5)
2021-12-20 23:01:40 +01:00
jackpoz 87e5b3a08c Scripts/Ulduar: Fix Ominous Clouds movements
Fix Ominous Clouds being only clockwise, now they move both clock and counter-clock wise.
Add a workaround for GenericMovementGenerator not handling correctly cyclic splines started by MoveCirclePath(), stopping the movement after a single round. The workaround code can be removed once the bug in GenericMovementGenerator is fixed.

(cherry picked from commit c1df161e1ddf95584030480d3dcb15149aacd7a6)
2021-12-20 22:34:14 +01:00
Giacomo Pozzoni ce25c212e0 Scripts/Ulduar: Attempt to fix Yogg-Saron not evading on wipe (#24055)
(cherry picked from commit 039534d1dbcde60b72c5b570be8e4cb5abb4f647)
2021-12-20 21:24:51 +01:00
Giacomo Pozzoni dd929665e5 Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24036)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon

Fix path generator returning shortcuts when start and end are on the same polygon by handling this case as if start and end were on 2 different polygons. This will ensure BuildPointPath() gets called which calls FindSmoothPath(), making sure each step is not longer than SMOOTH_PATH_STEP_SIZE (4 yards)

* Change ingame cast error message to SPELL_FAILED_NOPATH from SPELL_FAILED_OUT_OF_RANGE if the generated path is too long

(cherry picked from commit 29bf280e3496cf13c24ccb20e37da29d3bfa74d9)
2021-12-20 20:35:37 +01:00
Giacomo Pozzoni 7c97fa4449 Scripts/Misc: Fix build warnings
(cherry picked from commit 37ffdc05b23f079af3e22d7042f6ffe240e69cd5)
2021-12-19 23:31:30 +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
Giacomo Pozzoni 8d32849b34 Core/MMaps: Fix charge underwater/falling (#24010)
* Core/MMaps: Fix charge underwater

Fix charge sometimes returning "no path available" when swimming/underwater.
Fix charge selecting a destination point 4 yards above swimming/underwater targets

* Allow falling units to charge targets that are below (lower Z coordinate)

* Disable "raycast" pathfinding as it's not blizzlike.

This might show some strange paths when charging with a target in front.
It also fixes some falling undermap issues.

This Reverts 272009ebee

* Remove Z offset when charging a target as it never made sense

(cherry picked from commit 88a14251e2765880e90cb41be7919cd39e3308e2)
2021-12-19 15:54:09 +01:00
Giacomo Pozzoni 292df30394 Core/Movement: Fix wrong orientation set when pausing movement (#23986)
* Core/Movement: Fix wrong orientation set when pausing movement

* Update MoveSpline.h

* Update Unit.cpp

(cherry picked from commit e698c17a2688385e62744cdf5eb37b12b9e304fa)
2021-12-19 15:48:43 +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
Giacomo Pozzoni 96ec8477f0 Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)
(cherry picked from commit 18a4cbee5eb10cf0502ffae9c89ad468a2c58012)
2021-12-19 15:31:34 +01:00
Giacomo Pozzoni fda1630f74 Core/Spells: Fix Spellsteal stealing Silence buff of Arcane Torrent (#23992)
(cherry picked from commit 7920347f439b1c17805182a4f22d3b3b9f521a29)
2021-12-19 15:30:59 +01:00
Giacomo Pozzoni 1635a34228 Core/Movement: Add more LOS checks (#23991)
Add more LOS checks to ensure Units don't cross trees/walls when fleeing/moving

(cherry picked from commit 13ad8b66d9f4abcb55b4369a24d89d8cde3ca361)
2021-12-19 15:30:13 +01:00
jackpoz e6ac3316b7 Core/Map: Load the grid of TempSummons owned by Players
Ensure to load the grid of TempSummons owned by Players when the relocate to another cell

(cherry picked from commit afbc47891965f9c31c4b31c66931a2dbc9846f93)
2021-12-19 13:14:33 +01:00
jackpoz 7fb3b89d1d Scripts/Misc:Code cleanup
(cherry picked from commit 68fa3091a2d5497041e2fbc49c6caa4cb11f73d4)
2021-12-19 13:12:05 +01:00
Giacomo Pozzoni 64eb65cd45 Core/Creature: Remove empty spell ids from CreatureAddon.auras vector
Close #23969

(cherry picked from commit f20265feafbf28f722338649740bd11a9e48f2e7)
2021-12-19 01:46:07 +01:00
jackpoz 73e7719dbf Core/Creature: Log an error for Creatures spawned with temporary auras
The errors still need to be addressed.
Close #23225

(cherry picked from commit 54f94567649c78d146f4087cc874e4d0cbcff28b)
2021-12-19 01:44:53 +01:00
Giacomo Pozzoni 9bede687ce Core/GameObjects: Skip LoS checks for traps (#23936)
* Core/GameObjects: Skip LoS checks for traps

* Core/GameObjects: Fix spells cast by traps missing always

* Scripts/Spells: Fix WSG heal buff not healing

The WSG green heal buff is now cast by a GameObject so the spell target should be used to calculate the healing, not the GameObject.

(cherry picked from commit 909941e1b44250b0fa646d363af817f40ca48355)
2021-12-19 01:05:54 +01:00
jackpoz 9c154074ed Dep: Inherit C++ language version from CMake
(cherry picked from commit 92b25070b9d91b050bd1f3fb28b93c07a9b6ba04)
2021-12-19 00:33:43 +01:00
Giacomo Pozzoni 490c05080c Core/Build: Fix tools-only build
(cherry picked from commit c152e0f4158ca159b9617461ac6c254ff4868d2e)
2021-12-19 00:32:59 +01:00
jackpoz fa4830af80 Dep/Jemalloc: Update to Jemalloc 5.2.1
(cherry picked from commit 89cb584780aa936f9353fc8a2acd009c49461134)
2021-12-18 23:39:50 +01:00
jackpoz 0fb1bf8439 Core/Misc: Enable MaxCoreStuckTime setting by default
Enable MaxCoreStuckTime setting by default to force worldserver to exit in case of infinite loops.
Note that this will not affect existing setups with the setting MaxCoreStuckTime set to 0 in the local worldserver.conf .

(cherry picked from commit 00703ee238729a8d5b3d17edf8dc16d6c6c6b601)
2021-12-18 23:24:24 +01:00
jackpoz 58fe0f9e4a Build/Misc: Add ASan CMake flag
Allow to enable/disable Address Sanitizer in Clang and GCC from CMake flag "ASAN" of type Boolean. It can be enabled passing -DASAN=TRUE to CMake.

(cherry picked from commit 580f40769c6c446284dd1f5738f67fb3ee802956)
2021-12-18 23:03:00 +01:00
jackpoz 7d63166ff3 Core/GameObject: Fix battleground flags not showing burning animation
Fix battleground flags not displaying the typical burning animation when they "despawn" (they don't actually despawn, they just change state)

(cherry picked from commit 90bb10aa3a490fc701e6f98b32310687af80dea5)
2021-12-18 23:02:49 +01:00
jackpoz d5d04a6c55 Core/Misc: Fix C++17 build errors
(cherry picked from commit 30823f9b79b4ad16f96e90692a900f68a7f63c0a)
2021-12-18 22:51:50 +01:00
Giacomo Pozzoni 3da3683a90 Scripts/Kologarn: Fix "stuck in combat" issues (#23866)
Fix players stuck in combat with NPC_ARM_SWEEP_STALKER and/or both arms after killing the boss.

(cherry picked from commit fed030da190c9c53ad013d3e460ba1afbe1f02a2)
2021-12-18 22:47:49 +01:00
jackpoz 7d78ddcbd5 Core/AI: Add new method to force creatures around to stop combat
(cherry picked from commit 06443e38e761ed8ac7ce803c39bbbc7263983479)
2021-12-18 22:46:24 +01:00
Giacomo Pozzoni 4062c9763f Core/LFG: Fix re-queueing while in a dungeon (#23862)
Fix an issue that wouldn't allow to re-queue after joining a dungeon, having 1 member leave/get kicked, queue, leave, queue.
In this case a message "One or more dungeons was not valid" would be displayed because LFG would try to queue the group as "continue dungeon" but the current group was not marked as "in dungeon" state anymore.

(cherry picked from commit abcad7cda5375478f475bb9624c578169e84c559)
2021-12-18 22:43:38 +01:00
jackpoz 6c0412c3d9 Core/LFG: Remove Dungeon Cooldown when getting kicked
(cherry picked from commit ada4e431ae77cf56e6f5e4441b494dd25d6b3fb9)
2021-12-18 22:42:38 +01:00