Commit Graph
100 Commits
Author SHA1 Message Date
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
jackpoz 6f19b3980f Dep/Jemalloc: Update to Jemalloc 5.2.0 2019-05-12 01:23:06 +02:00
jackpoz 836e52479b Core/Misc: Apply fatigue when flying too
Fix #22856
2019-05-12 01:21:36 +02:00
jackpoz 950eff5fda Core/LFG: Remove dungeon cooldown when completing random dungeons 2019-05-05 00:26:13 +02:00
jackpoz 4da12422eb Core/MMaps: Revert PATHFIND_INCOMPLETE handling change in ChaseMovementGenerator in 386b5a6fd948b4866cbd9a8a9892e8777922e9c9 since the current hp reset code in Creature::Update() will reset the hp of bosses as soon as CanNotReachTarget() is true. In case of boss mechanics like Abub'Rekhan at Naxx where the boss throws the player in the air, a PATHFIND_INCOMPLETE path is returned.
The code in Creature::Update() should be modified to wait a few seconds before resetting the hp. PATHFIND_NOPATH / PATHFIND_INCOMPLETE don't really mean that the Creature can't attack the player anyway either.

# Conflicts:
#	src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp
2019-04-29 08:44:37 +02:00
jackpoz 66f2bd91bb Shared/Metric: Fix a rare memory leak
Fix a memory leak in Metric happening only when enabling/disabling Metric from configs at runtime, leaking the metric added between last SendBatch() call and the ScheduleSend() call in the same function. The only way to reproduce this is to actually freeze the thread calling SendBatch(), disable metric, reload config, unfreeze the thread.
2019-04-27 21:10:05 +02:00
jackpoz a730e17a37 Core/Commands: Fix .cheat god command letting you die
Fix .cheat god command still letting you die with Area Aura like Slime near Thaddius, broken since 777b287dff

# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
2019-04-27 21:09:46 +02:00
jackpoz 0020ea9f92 Core/Maps: Fix crash caused by setActive(false) called after DespawnOrUnsummon()
Fix crash caused by WorldObject::setActive(false) called after WorldObject::DespawnOrUnsummon() happening because the WorldObject would be set as not active but then Map::RemoveFromActiveHelper() would not be called because of not being in world anymore.
Whenever setActive() gets desync'd with what Map actually contains a rare crash would happen since Map only reads a few values of the active WorldObject, making it hard to reproduce. If this happens again some ASSERT calls should be added (or a check in Map::RemoveFromMap() could be added about if the WorldObject is in Map::m_activeNonPlayers container).
2019-04-27 21:08:52 +02:00
jackpoz 738aa92782 Core/Spells: Adjust range checks to GameObject targets 2019-04-26 18:01:19 +02:00
jackpoz 85bf4daf45 Core/Spells: Adjust range checks to GameObject targets 2019-04-26 18:01:12 +02:00
jackpoz d99de4db33 Core/Spells: Add range checks to GameObject targets
Close #23062
Patch by robinsch
2019-04-26 18:01:05 +02:00
jackpoz 5ef08fa5e8 Core/GameObject: Code cleanup
(cherry picked from commit 16a154c4e87ff1ff89323a8960bf601e6c18589b)
2019-04-26 17:53:43 +02:00
jackpoz 237901719a Core/MMaps: Fix crash added in 386b5a6fd948b4866cbd9a8a9892e8777922e9c9
# Conflicts:
#	src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp

* fixed cherrypick conflicts
2019-04-14 12:27:49 +02:00
jackpoz 5cb3e69e1e Core/MMaps: Simplify d182e5f7e73e614185f4470429467befd6e03981 and handle PATHFIND_INCOMPLETE in ChaseMovementGenerator as "cannot reach the target"
# Conflicts:
#	src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp
2019-04-14 12:13:59 +02:00
jackpoz 6552a00208 Core/MMaps: Fallback to shortcut for flying units if Detour returned an incomplete path.
Fallback to shortcut for flying units if Detour returned an incomplete path. This is needed when a flying unit should fly to the floor below to reach the target, but since Recastnavigation doesn't support "jumping down" the unit would not find a path to the target.
2019-04-14 12:12:15 +02:00
jackpoz 6fbf6d73db Dep/Recast: Update recastnavigation to https://github.com/recastnavigation/recastnavigation/commit/54bb0943e5174a71eeeca11919920f685760a4f0
(cherry picked from commit e061663508191f7782dd62c7e13b5ea804f58f67)

# Conflicts:
#	dep/recastnavigation/Detour/Source/DetourCommon.cpp
2019-04-14 12:11:34 +02:00
jackpoz 927d7518ca Dep/Jemalloc: Update to Jemalloc 5.1.0 2018-05-12 13:24:51 +02:00
jackpoz a5cad33ba0 Scripts/Icecrown Citadel: Fix "intended" crash
Change an assert (that can happen easily using ".npc add") to a sanity check
2018-05-12 13:23:44 +02:00
jackpoz 7df6a6bbcb Dep/Boost: Fix crash in Boost
Work around a NULL dereference exception happening in boost::asio::ip::tcp::resolver::results_type, resulting in a crash when trying to bind on an address that cannot be resolved.
Fixes #21884
2018-04-29 17:46:44 +02:00
jackpoz 19ce97eae4 Core/SmartScripts: Code cleanup 2018-03-12 12:40:23 +01:00
jackpoz 86f03d79cc Core/Spells: Revert SPELL_ATTR2_IGNORE_ITEM_CHECK to unknown
Revert SPELL_ATTR2_IGNORE_ITEM_CHECK to unknown, too many spells unrelated to items have this attribute and the current handling was causing exploits with "Mote of Water" and other elements.
Fix #19547
2018-02-18 18:37:00 +01:00
jackpoz bb70a60ba7 Core/Misc: Add PERFORMANCE_PROFILING CMake option
Add a new CMake option called PERFORMANCE_PROFILING that should be used only when profiling the performance.
This option is unsupported, do not report any issue happening when enabling this option.
2018-02-18 18:36:32 +01:00
jackpoz 4a7089b10a Core/Misc: ASSERT() cleanup
Move some functions calls out of ASSERT() calls. ASSERT() should only apply checks without modifying any object and without having any side effect.
2018-02-18 18:00:27 +01:00
jackpoz bee461eda8 Core/Player: Add some asserts
Assert PlayerInfo for race/class pair in a few Player functions
2018-02-16 01:04:11 +01:00
jackpoz 46467499f3 Scripting/Obsidian Sanctum: Fix crash
Fix crash caused by calling Reset() in constructor (which is not allowed)
2018-02-16 01:03:56 +01:00
jackpoz d1df97db23 Shared/Database: Improve dead-lock error handling
Improve dead-lock error handling in async transactions by retrying the transaction for up to 60 seconds instead of just 5 times
2018-02-10 16:16:14 +01:00
jackpoz 8e5c1d012d Core/Misc: Fix no-pch build 2018-02-10 11:34:26 +01:00
jackpoz 57314740da Core/AI: Fix assertion triggered with PetAI derived scripts (#21254)
* Core/AI: Fix assertion triggered with PetAI derived scripts

Fix an assertion triggered when spawning through ".npc add" or from SQL db table a Creature with AI set to a custom AI inheriting from PetAI.
2018-02-10 11:33:51 +01:00
jackpoz b263e63a50 Core/Crash reporting: Add support to char* arrays
Add support to char* array showing the string value instead of the pointer address
2018-01-01 16:14:37 +01:00
jackpoz e72f6e31be Core/Misc: Removed unneeded checks 2018-01-01 16:13:59 +01:00
jackpoz 5a61b3ce5e Core/Misc: Fix static analysis issues 2018-01-01 15:50:42 +01:00
jackpoz ff26ce4f97 Core/CreatureAI: Disable PetAI from database 2017-12-26 17:28:29 +01:00
jackpoz 4283252731 Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver
2017-12-17 15:37:30 +01:00
jackpoz 90344d2dd8 Core/Spells: Fixed Naxx Anub Scarab Summoning Spell
Reduce spell radius of 28864 and 29105 from 100 yards to 10 yards to spawn scarabs closer
2017-12-17 10:50:37 +01:00
jackpoz 21cad46097 Core/Misc: Fix static analysis issues 2017-12-08 15:24:13 +01:00
jackpoz 814d938194 Core/Misc: Fix static analysis issues
Fix coverity id 1382860
2017-12-08 12:50:28 +01:00
jackpoz 84abf3a1a6 Shared/Metric: Stop metrics on shutdown
Properly stop metric information gathering and sending on shutdown.
Issue reported by AddressSanitizer.
2017-12-03 17:12:20 +01:00
jackpoz d9501acb3f Core/Spell: Validate spell_dbc DB data on startup
Validate spell_dbc DB data on startup (max effect type, max aura type, max target type).
Delete some invalid spells from spell_dbc table. Make sure to apply the SQL script or worldserver will assert on startup.
2017-12-03 17:11:41 +01:00
jackpoz 081e7aa708 Core/Misc: Fix out of bounds access on startup
Fix out of bound access on startup trying to access SpellEffects with ID greater than max allowed/known.
Reported by AddressSanitizer .
2017-12-02 12:58:34 +01:00
jackpoz 27be32968d Core/Crash reporting: Fix buffer overflow 2017-12-02 05:11:07 +01:00
jackpoz 2507d601b7 Core/CreatureAI: Disable TotemAI from database
Disable TotemAI set in creature_template, triggering an assert when spawning the creature
2017-12-02 05:10:57 +01:00
jackpoz a693169a7e Dep/Jemalloc: Enable MADV_FREE if available 2017-11-30 08:44:33 +01:00
jackpoz 05b568813f Dep/Jemalloc: Temporarily disable MADV_FREE
Temporarily disable MADV_FREE until CMake file is modified to check if MADV_FREE is available on the current system.
This fixes the build on older systems.
2017-11-30 08:44:16 +01:00
jackpoz 52a53ea2ab Core/Maps: Fix memory leak in BoundaryUnionBoundary
Add missing destructor in BoundaryUnionBoundary to avoid reporting a memory leak (even if it's used only in a global variable)
2017-11-26 12:31:36 +01:00
jackpoz 55637dc00d Core/Quests: Fix memory leak in Quest Greeting 2017-11-26 11:53:49 +01:00
jackpoz 41469a4161 Dep/Jemalloc: Update to Jemalloc 5.0.1 2017-11-25 14:03:02 +01:00
jackpoz 5dee28845c Dep/Jemalloc: Update to Jemalloc 4.0.4 2017-11-19 19:24:08 +01:00
jackpoz 259e534cca Tools/MMaps: Improve MMaps quality
Lower Detail Sample Distance and Detail Sample Max Error to get more accurate MMap data, in particular mmap height.
More info about Detail Mesh at http://digestingduck.blogspot.it/2009_07_01_archive.html and http://digestingduck.blogspot.it/2009_08_01_archive.html
2017-11-19 18:03:35 +01:00
jackpoz c62b81dd8b Dep/Recast: Update recastnavigation to recastnavigation/recastnavigation@2c85309 2017-11-19 18:03:17 +01:00
jackpoz 67dc6a7576 Core/Misc: Fix static analysis issues 2017-11-12 13:24:42 +01:00
jackpoz 790c2b6e80 Dep/G3D: Add static assert checks for Array functions being used with non-POD types 2017-11-12 13:20:51 +01:00
jackpoz 3410edfdae Core/Misc: Fix static analysis issues 2017-07-17 18:51:56 +02:00
jackpoz 2102bd28a3 Core/Scripts: Simplify code
Partially revert 753e7074d84b5a2e8d3c3e92d25c54bb25ba477e and 12c680f9b1f1068099c3b19443d93d456690ac56 to simplify the code and to only remove GMs from the target list.
2017-06-09 13:25:59 +02:00
jackpoz 1664c1bd2e Core/Misc: Fix static analysis issues 2017-04-26 05:09:44 +02:00