Commit Graph
100 Commits
Author SHA1 Message Date
jackpoz 8746d9f56a Core/Misc: Fix static analysis issues
(cherry picked from commit 486b03234304526d8f7d66ff0d99ea3de975745e)
2022-02-16 04:49:24 +01:00
Giacomo Pozzoni 2c4a20da24 DB: Add drop script compatible with MySQL 8 2022-01-08 22:46:10 +01:00
jackpoz 48130896d8 Scripts/BlackrockSpire: Fix infinite loop in Gyth fight
Fix infinite loop in Gyth fight and double event caused by Rend Blackhand being respawned.
Please note this event is completely bugged and unfinished and contains for sure more bugs.
2021-12-28 23:36:16 +01:00
Giacomo Pozzoni adde43e965 Core/AI: Fix crashes caused by charmed Creatures having null AI for 1 map update tick (#27434)
Implement using ScheduledChangeAI instead of nullptr to signal a required AI change
# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Unit/Unit.h
2021-12-27 22:25:11 +01:00
jackpoz 1ea6bef697 Core/SOAP: Fix memory leak on shutdown reported by ASan 2021-07-31 21:44:43 +02:00
jackpoz 24d4e6977c Core/SOAP: Fix new/free mismatch reported by ASan 2021-07-31 21:44:38 +02:00
Giacomo Pozzoni d02324b507 CI/CircleCI: Force ccache directory (#26625)
(cherry picked from commit 6c5b641dd44a8d174d9bb8da36200e81b16f9ae8)
2021-07-29 19:07:52 +02:00
Giacomo Pozzoni 1c4e4353d0 CI/CircleCI: Switch to Ubuntu 21.04 (#26476)
(cherry picked from commit 5991dcb12b638a0ef483fddeeda3e5744012dda6)
2021-07-29 19:07:52 +02:00
Giacomo Pozzoni d10f844697 CI/CircleCI: Authenticate to DockerHub when pulling the docker image (#25581)
For more information see the following links:
- https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/
- https://docs.docker.com/docker-hub/download-rate-limit/
- https://circleci.com/docs/2.0/private-images/

Add DOCKERHUB_USERNAME and DOCKERHUB_PASSWORD secrets to CircleCI Environment Variables. DOCKERHUB_PASSWORD can be either the password or an access token.

(cherry picked from commit e3da1ed2455676cfe31757cbd816d92ee1d93a3c)
2021-07-29 19:07:52 +02:00
Giacomo Pozzoni d4780e0b96 CI/CircleCI: Move codestyle and sql checks to their own step (#25175)
(cherry picked from commit f35582f98a6dbf7d031646bc3efe6b88d4694dcb)
2021-07-29 19:07:52 +02:00
jackpoz 5d9b3b59d2 Core/Misc: Remove whitespace 2021-07-29 17:32:15 +02:00
jackpoz d53a176746 Core/MMAPs: Reduce chances of breaking tile connections
Reduce chances of breaking tile connections caused by floating point rounding issues.
2021-07-29 17:32:05 +02:00
jackpoz 5a08b65cef Core/Maps: fixed a floating point issue when retrieving minHeight values from GridMap 2021-07-06 20:51:19 +02:00
Giacomo Pozzoni d83cd33bd4 Core/Pools: Fix pools with 1 member never spawning anything anymore (#26620)
* Core/Pools: Fix pools with 1 member never spawning anything anymore

Attempts to fix a 6 years old bug and never fixed by the original author.

* Remove respawn times from db once a respawn has been handled

* Allow to specify if Despawn1Object() should save or not the respawn time. We don't need to do that when respawning an object.

* Apply the same fix to GameObjects too
# Conflicts:
#	src/server/game/Pools/PoolMgr.h
2021-06-27 06:33:19 +02:00
jackpoz ea85a0031c Scripts/UBRS: Fix crash
Fix crash triggered during Dragonspire Hall event caused by having more than 5 mobs near a rune.
Crash added in 7c19fb8d0e
Fix #26589
2021-06-12 18:12:13 +02:00
Giacomo Pozzoni 490188de76 Core/Maps: Change .map file version from FourCC to uint32 2021-04-05 12:17:12 +02:00
jackpoz 7d2c2f3890 CI/AppVeyor: Add artifact without symbols for smaller download size 2021-03-14 09:33:52 +01:00
Giacomo Pozzoni 3cc50b98a6 CI/CircleCI: Expose binaries built on Circle CI as docker images in the Circle CI artifacts 2021-03-11 10:53:51 +01:00
Giacomo Pozzoni c12531b023 Core/Maps: Use a fixed offset instead of full collision height when retrieving floor Z 2021-02-21 20:26:21 +01:00
Giacomo Pozzoni 48a0dde345 Core/Creature: Add new db field InteractionPauseTimer
Add new db field InteractionPauseTimer to allow to define different interaction pause timers for each creature (the previous system was a global setting in worldserver.conf Creature.MovingStopTimeForPlayer)

Set all columns in creature_template_movement as optional (can be NULL, default NULL). Fill only the columns that should override the default C++ value
2021-02-21 16:50:55 +01:00
Giacomo Pozzoni 5e3b57bae7 Core/Unit: Fix movement hiccups in water
* Core/Unit: Allow to define Units which can enter water but cannot swim

Allow to define Units which can enter water but cannot swim, i.e. crabs walking at the bottom of a sea.

* Add UNIT_FLAG_SWIMMING to creatures when entering combat

* Fix charmed creatures not entering water

* Always allow Creatures controlled by players to enter water

* Add swimming flag when possessing a unit and remove it properly at the end, even if the creature engaged combat before and after.
When adding/removing UNIT_FLAG_SWIMMING manually calling Creature::RefreshSwimmingFlag(true) might be required.
2021-01-11 12:33:54 +01:00
jackpoz a177a5977d Dep/Boost: Set boost msvc version on Windows to 14.2
14.2 is the only supported one (Visual Studio 2019)
2020-12-30 19:31:40 +01:00
jackpoz f53708fec1 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).

# Conflicts:
#	src/tools/mmaps_generator/PathGenerator.cpp
2020-10-16 15:56:05 +02:00
Giacomo Pozzoni 1de869764d 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.
# Conflicts:
#	src/tools/mmaps_generator/PathGenerator.cpp
2020-10-16 15:50:59 +02:00
Giacomo Pozzoni 8bbe17c684 Core/Creature: Ignore combat reach when looking for assisting creatures 2020-09-24 00:37:11 +02:00
Giacomo Pozzoni fe30a6ef00 Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear 2020-09-11 21:33:54 +02:00
Giacomo Pozzoni 2cea40a466 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.

# Conflicts:
#	src/server/scripts/Spells/spell_generic.cpp
2020-09-11 15:12:12 +02:00
jackpoz 129614cbf8 Core/PathFinding: Enable pathfinding (MMaps) by default 2020-09-08 20:58:37 +02:00
Giacomo Pozzoni 6a8ecc3ee3 Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis

* Core/Vmaps: Code cleanup after e777161888
# Conflicts:
#	src/common/Collision/DynamicTree.cpp
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/World/World.cpp
2020-08-29 13:49:21 +02:00
jackpoz 5989ad860c Core/Movement: Fix RandomMovementGenerator for swimming creatures
Fix RandomMovementGenerator for swimming creatures not moving at all due to PATHFIND_FARFROMPOLY being handled as wrong path.
2020-08-23 20:38:03 +02:00
Giacomo Pozzoni 9c77105040 Core/Combat: Disable triggers entering combat (#25086)
* Core/Combat: Disable triggers entering combat

* Move check to database flags_extra flag in creature_template with value 0x00002000

* Fix Rotface puddle stalker too

* Rename 9999_99_99_99_world.sql to 2020_07_22_00_world.sql
# Conflicts:
#	src/server/game/Entities/Creature/Creature.h
#	src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
2020-07-24 00:18:25 +02:00
Giacomo Pozzoni 509499efbe 3.3.5 threat assert (#23034)
* Core/Creature: Change assert about Threat to log
2020-07-22 18:00:15 +02:00
jackpoz bad4b80374 Core/Misc: Fix issues reported by dynamic analysis
Closes #23021
2020-07-22 17:59:42 +02:00
jackpoz 84ee3701d5 Core/Thread: Fix crash added in fd33b1cd02a1c69fc78f47f079eadc43c331d054
Fix crash caused by dereferencing uninitialized field.
2020-07-22 17:34:54 +02:00
jackpoz 936d88c2ca Scripts/Commands: Allow to use .tele in combat only to GMs
Allow to use .tele in combat only to players who can be GMs (even if they have .gm off)
2020-07-22 16:58:09 +02:00
jackpoz 05330c2cc8 Core/Misc: Fix static analysis issues 2020-07-22 14:40:00 +02:00
Giacomo Pozzoni 52d9bb2538 Core/Threads: Replace Boost TLS with C++11 one (#15782)
* Core/Threads: Replace Boost TLS with C++11 one

Replace boost::thread_specific_ptr<T> thread-local storage with C++11 thread_local to remove libboost_thread dependency from common project

* Fix no-pch build
2020-07-18 22:48:03 +02:00
Giacomo Pozzoni cbb0fe41de Core/Misc: Replace boost::shared_mutex with std::shared_mutex (#24328)
* Core/Misc: Replace boost::shared_mutex with std::shared_mutex

* Remove std forward declarations
# Conflicts:
#	src/server/game/Loot/LootItemStorage.h
2020-07-18 22:38:50 +02:00
Giacomo Pozzoni e89aef40c5 Dep/Boost: Set boost version to 1.67 on *nix and 1.70 on Windows (#25069)
# Conflicts:
#	dep/boost/CMakeLists.txt
2020-07-18 22:38:00 +02:00
jackpoz cb6611b048 Core/MMAPs: Fix small steps being considered as NAV_AREA_GROUND_STEEP 2020-06-26 21:27:04 +02:00
jackpoz 6622a94384 Tools/MMAPs: Output the time spent in a human readable format
# Conflicts:
#	src/tools/mmaps_generator/PathGenerator.cpp
2020-06-22 11:34:55 +02:00
Giacomo Pozzoni 85532de2e9 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
# Conflicts:
#	src/server/game/Movement/PathGenerator.cpp
2020-06-18 02:16:11 +02:00
jackpoz 79c707e6ec Build/CMake: Increase minimum version to 3.8
(cherry picked from commit 965ac6fb08623b13c2486f9d09967dd00f3d396f)

# Conflicts:
#	CMakeLists.txt
2020-06-16 10:51:56 +02:00
Giacomo Pozzoni 29a987b81b Build/CMake: Set some policies to NEW (#23779)
* Build/CMake: Set CMP0005 to NEW

See https://cmake.org/cmake/help/v3.2/policy/CMP0005.html

* Build/CMake: Set CMP0043 to NEW

See https://cmake.org/cmake/help/v3.2/policy/CMP0043.html

* Build/CMake: Set CMP0074 to NEW

See https://cmake.org/cmake/help/v3.12/policy/CMP0074.html

(cherry picked from commit 18cc36bc67023dc9ca58e77733c2b8c74655cf86)
2020-06-16 10:51:06 +02:00
jackpoz 3f56ea8ba4 Core/Misc: Fix Clang 10 build warnings
(cherry picked from commit 48c5c0d7a2424df73343df127d415ee18eb84296)
2020-06-11 20:49:30 +02:00
Giacomo Pozzoni 9fdf598792 Cherry-pick some cmake commits (#24720)
* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f160816818681ed7e41063e2d9ba5b5)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d5190dabc686a35656e8b03f5ec325b)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4b51ec5591b6f0e542ea29091db7546)

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba398d5d9343a5dcd1a89562dfcbe981)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c567180b408ddbadb9edf26859cf4c006)

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201189877c1b863fac140eb4b0a45c5bb)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b7643c62f9e7705c64e42d42e5d07f1959)

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 8c09b6e58b0e4f33b7a8e376a28709e693cf2914)
2020-06-11 20:24:00 +02:00
jackpoz 928abcbfdc CI/CircleCI: Switch to Ubuntu 20.04 and MySQL 8
(cherry picked from commit e3dfab52a639275ea130d279f4a6fe4312d34b06)
2020-06-11 16:52:57 +02:00
jackpoz 364d3fa0aa CI/Circle CI: Enforce codestyle checks
(cherry picked from commit 32c9f1c7a228db33110ab0ab5975ba37cba85106)
2020-06-11 16:50:33 +02:00
jackpoz c62ebf6e36 Core/Misc: Add console option to update databases only
Add "--update-databases-only" console argument to stop worldserver execution after having updated all databases (if specified in config file)

(cherry picked from commit 92bf5b1ba795303808c5f1b3bf82dd0204133ed8)
2020-05-19 00:49:24 +02:00
Giacomo Pozzoni e3bab35d5e 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 <dreadkiller@gmx.de>
# Conflicts:
#	src/server/game/Entities/Object/Object.cpp
2020-05-16 13:45:57 +02:00
jackpoz d0c7bbab40 Core/Misc: Update 85e3169fbd7b2da70e0f054399f4db64ded36325 about SOAP
Change again how SOAP is stopped if SOAP successfully binds but worldserver fails to bind its sockets.
A crash remains if SOAP fails to bind because it calls exit() and that triggers asserts everywhere.
2020-05-06 00:01:21 +02:00
jackpoz 03609506ae Core/Networking: Set SO_REUSEADDR on *nix platforms 2020-05-06 00:01:17 +02:00
jackpoz c82bddf6f4 Core/Misc: Fix shutdown with SOAP enabled
Fix worldserver entering a loop when having SOAP enabled but failing to bind both SOAP and worldserver listened socket. SOAP thread would keep trying to bind the socket over and over checking World::IsStopped() condition that was never set to true
2020-05-06 00:01:09 +02:00
Giacomo Pozzoni 2e9f4285d9 Build: Add support to MariaDB 10.4 on Windows
MariaDB 10.4 (latest stable) is the only supported version.
2020-05-05 16:27:07 +02:00
Giacomo Pozzoni 08fbf3974e Core/Database: Fix build with Maria DB on some distros (#24248) 2020-05-05 16:27:07 +02:00
jackpoz c5c99f1eea Core/PathFinding: Fix buffer overflow 2020-04-29 22:37:55 +02:00
jackpoz 3f7c7dcc30 Core/Spells: Fix assertion triggered 2020-04-22 17:04:57 +02:00
Giacomo Pozzoni dd6498b8f9 Core/Database: Close the MySQL connection only after getting the last error code 2020-04-15 11:06:18 +02:00
jackpoz 1ddcb029d5 Build/CMake: Code cleanup 2020-04-07 01:14:11 +02:00
jackpoz b58bd5a7b2 Build/CMake: Increase minimum version to 3.8 2020-04-07 01:14:00 +02:00
jackpoz 2de72f78d8 Scripts/Guards: Fix spell cast spam after killing npc_air_force_bots guards 2020-04-05 21:05:14 +02:00
jackpoz d781c12b57 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.

# Conflicts:
#	src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp
2020-04-04 19:13:21 +02:00
jackpoz 14e585d66b 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.
2020-04-04 19:11:23 +02:00
jackpoz eba5dafada 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.
2020-04-04 19:09:48 +02:00
jackpoz f55b15c585 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.
2020-04-04 19:03:31 +02:00
Giacomo Pozzoni e69cd41669 Require Visual Studio 2019 16.4 or greater (#24214)
* CI/AppVeyor: Add appveyor.yml file

* Build: Require Visual Studio 2019 16.4 or greater

* CI/AppVeyor: Upgrade to VS2019 image

* Update cmake error message

* CI/AppVeyor: Fix appveyor VS 2019 configuration
2020-04-04 18:42:10 +02:00
jackpoz 359eb2bc67 Core/Spells: Fix missing "Inventory is full" with spells that create more than 1 item 2020-03-19 23:31:35 +01:00
Giacomo Pozzoni c2913e608f Build: Enable and require c++17 2020-03-16 14:14:46 +01:00
jackpoz fdd986ec46 Dep: Inherit C++ language version from CMake 2020-03-16 14:14:46 +01:00
jackpoz 9eafd794f8 Core/PathFinding: Fix mmaps raycast without hit
Update Z coordinate of end position when casting a mmap raycast that doesn't hit the target
2020-03-05 18:20:40 +01:00
jackpoz 004e39d88c 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.
2020-02-27 14:05:47 +01:00
jackpoz a378f23d80 Core/PathFinding: Add support to WorldObject pathfinding 2020-02-20 21:45:36 +01:00
jackpoz e9318828b5 Core/MMaps: Handle path on same position
Handle path on the same polygon between 2 very close positions as a normal path.
2020-02-20 21:36:13 +01:00
Giacomo Pozzoni 9c6514847f 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
2020-02-20 21:34:33 +01:00
jackpoz e4dba606cb 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
2020-02-20 21:31:26 +01:00
Giacomo Pozzoni cad41332ba 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
2020-02-20 21:29:46 +01:00
Giacomo Pozzoni fbe4abf3be 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
2020-02-20 21:27:00 +01:00
jackpoz c3d2b2c6d5 Core/PathFinding: Return raycast hitpoint when specifying straightLine 2020-02-08 23:32:09 +01:00
jackpoz 6eb44dff00 Core/Misc: Fix clang 6.0 warnings
Ported from e9bcae1fada64bc3400c3204f7365edcecd640cc
2020-01-31 21:41:33 +01:00
jackpoz 183789053e Core/Misc: Fix GCC 8 warnings 2020-01-31 21:19:25 +01:00
jackpoz 8714c2be57 Core/Utils: Handle UTF-8 conversion errors
Replace the output string when a UTF-8 conversion error happen with an error message instead of using an empty string, swallowing any message that the caller wanted to log.
2020-01-31 20:51:51 +01:00
Giacomo Pozzoni ac8bf86755 Core/Scripts: Change PlayerScript and CreatureScript inheritance
Remove UnitScript from PlayerScript and CreatureScript classes as that's how the original system that was PR'd worked, see https://github.com/TrinityCore/TrinityCore/pull/7867 for reference.
Please note these are used as global hooks and should really just invoke stateless functions.
If you need to hook methods from PlayerScript/CreatureScript and UnitScript, just define 2 different scripts (this is how the original system worked and how it was designed to work)
2020-01-28 07:41:43 +01:00
jackpoz 316986765f 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
2020-01-28 05:55:09 +01:00
jackpoz 131986d1c2 Core/Misc: Replace time(nullptr) with GameTime::GetGameTime() 2020-01-11 03:30:41 +01:00
Giacomo Pozzoni ccb00b971b Fix fleeing speed to 66% run speed 2020-01-03 21:45:40 +01:00
Giacomo Pozzoni dfaf4f57a6 Core/Movement: Fix wrong orientation set when pausing movement 2019-12-30 18:54:28 +01:00
Giacomo Pozzoni 42e0a6f1f7 Core/Movement: Fix stunned falling units freezing the client 2019-12-30 18:50:43 +01:00
jackpoz e5a240cd7f Core/Movement: Fix fleeing speed to 66% run speed 2019-12-30 18:49:03 +01:00
jackpoz 7e5e553bac Dep/Jemalloc: Update to Jemalloc 5.2.1 2019-11-05 16:06:13 +01:00
Giacomo Pozzoni e73c7dc2e4 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.
2019-10-07 00:45:56 +02:00
Giacomo Pozzoni 354927050b Core/LFG: Remove Dungeon Cooldown when getting kicked 2019-10-07 00:44:24 +02:00
Giacomo Pozzoni fd8e20893d Core/MovementGenerator: 680e1cb follow-up 2019-09-22 13:55:47 +02:00
Giacomo Pozzoni 2bacebe93b Core/MovementGenerator: Fix crash in taxi paths
Fix a crash in taxi paths happening when joining a battleground/dungeon while on a taxi path after second last node but close to last node, then leaving/finishing the battleground.
2019-09-17 15:56:42 +02:00
Giacomo Pozzoni e8b9723b02 Core/Movement: Fix LoS issue of NPCs chasing targets
Add Line of Sight checks to ChaseMovementGenerator::Update(), fixing to ChaseMovementGenerator not reaching a point with valid LoS to the target.

Fix re-implements 8927a04253 after 2a84562dc85516f432bb1e5de9add23c28b26ce4 partially removed it.

Fix #23724
2019-09-14 02:58:53 +02:00
jackpoz 0b79415e59 Buildsystem: Fix finding VS 2019 compiled boost libs 2019-09-12 01:09:04 +02:00
jackpoz 8a1828aa43 Core/Misc: Fix linux build 2019-08-18 11:53:01 +02:00
jackpoz b407e6da1c Core/MMaps: Fix mobs evading when target is out of MMap meshes
Fix mobs evading when target is out of MMap meshes causes by an overzealous check added in c602220e02bed1ad76c9e60064eeec5fd97bfe80 when trying to fix an infinite loop in Recast.
If the target is outside of the MMap mesh (for example very close to a wall which is an un-walkable area with current TrinityCore settings and that might be changed in the future) Detour will not be able to find the height of the poly and getPolyHeight() will return DT_FAILURE | DT_INVALID_PARAM . Most of the time this is ok and can be ignored and it's still better than having the Unit evade.
Fix #23613
2019-08-18 11:52:54 +02:00
Giacomo Pozzoni 662ccb533b Core/Quest: Fix repeatable quest mark (#23338)
# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
2019-07-06 15:27:32 +02:00
Giacomo Pozzoni 2190cf9524 3.3.5 game event respawn (#23391)
* Core/GameEvent: Remove respawn times of Creature and GameObjects when starting/stopping an event

* Add checks for pool

* Remove the check for pools
2019-06-15 16:00:12 +02:00
jackpoz ebaafd20cd Core/Loot: Fix group loot if player loot recipient disconnects
Fixes #13300
2019-05-27 16:08:06 +02:00